concat all inputs as object. DatetimeIndex, TimedeltaIndex and
    PeriodIndex are converted to object dtype before concatenation
973093
def _concat_index_asobject(to_concat, name=None):
    
    from pandas import Index
    from pandas.core.arrays import ExtensionArray

    klasses = (ABCDatetimeIndex, ABCTimedeltaIndex, ABCPeriodIndex,
               ExtensionArray)
    to_concat = [x.astype(object) if isinstance(x, klasses) else x
                 for x in to_concat]

    self = to_concat[0]
    attribs = self._get_attributes_dict()
    attribs['name'] = name

    to_concat = [x._values if isinstance(x, Index) else x
                 for x in to_concat]

    return self._shallow_copy_with_infer(np.concatenate(to_concat), **attribs)
186781
def duration_to_timedelta(obj):
    
    matches = DURATION_PATTERN.search(obj)
    matches = matches.groupdict(default="0")
    matches = {k: int(v) for k, v in matches.items()}
    return timedelta(**matches)
679416
def concat(dfs):
    """"""
    if isstr(dfs) or not hasattr(dfs, '__iter__'):
        msg = 'Argument must be a non-string iterable (e.g., list or tuple)'
        raise TypeError(msg)

    _df = None
    for df in dfs:
        df = df if isinstance(df, IamDataFrame) else IamDataFrame(df)
        if _df is None:
            _df = copy.deepcopy(df)
        else:
            _df.append(df, inplace=True)
    return _df
1271968
def timetopythonvalue(time_val):
    ""
    if isinstance(time_val, sequence):
        return map(timetopythonvalue, time_val)
    elif isinstance(time_val, numeric):
        return datetime.datetime(*(time.gmtime(time_val))[:6])
    elif isinstance(time_val, numeric):
        values = []
        try:
            values = map(long, time_val.split(","))
        except:
            pass
        if values:
            return map(timetopythonvalue, values)
    raise ValueError(repr(time_val))
1276066
function _object2array(input) {

		var index,
			subindex = 0,
			result = [];

		if (typeof input !== 'object' || !input)

			return input;

		for (index in input) {

			if (subindex++ !== Number(index))

				return input;

			result.push(input[index]);

		}

		return result;

	}
103532
def _join_i8_wrapper(joinf, dtype, with_indexers=True):
        
        from pandas.core.arrays.datetimelike import DatetimeLikeArrayMixin

        @staticmethod
        def wrapper(left, right):
            if isinstance(left, (np.ndarray, ABCIndex, ABCSeries,
                                 DatetimeLikeArrayMixin)):
                left = left.view('i8')
            if isinstance(right, (np.ndarray, ABCIndex, ABCSeries,
                                  DatetimeLikeArrayMixin)):
                right = right.view('i8')
            results = joinf(left, right)
            if with_indexers:
                join_index, left_indexer, right_indexer = results
                join_index = join_index.view(dtype)
                return join_index, left_indexer, right_indexer
            return results

        return wrapper
351862
def merge_datetime(date, time='', date_format='%d/%m/%Y', time_format='%H:%M'):
    """"""
    day = datetime.strptime(date, date_format)
    if time:
        time = datetime.strptime(time, time_format)
        time = datetime.time(time)
        day = datetime.date(day)
        day = datetime.combine(day, time)
    return day
654567
def concat(cls, variables, dim='concat_dim', positions=None,
               shortcut=False):
        
        if not isinstance(dim, str):
            dim, = dim.dims

        variables = list(variables)
        first_var = variables[0]

        if any(not isinstance(v, cls) for v in variables):
            raise TypeError('IndexVariable.concat requires that all input '
                            'variables be IndexVariable objects')

        indexes = [v._data.array for v in variables]

        if not indexes:
            data = []
        else:
            data = indexes[0].append(indexes[1:])

            if positions is not None:
                indices = nputils.inverse_permutation(
                    np.concatenate(positions))
                data = data.take(indices)

        attrs = OrderedDict(first_var.attrs)
        if not shortcut:
            for var in variables:
                if var.dims != first_var.dims:
                    raise ValueError('inconsistent dimensions')
                utils.remove_incompatible_items(attrs, var.attrs)

        return cls(first_var.dims, data, attrs)
175670
def list_concat(input, **params):
    
    PARAM_SOURCE_FIELDS = 'src.fields'
    PARAM_DEST_FIELD = 'dest.field'

    field_list = params.get(PARAM_SOURCE_FIELDS)
    for row in input:
        res = []
        for field in field_list:
            res += row[field]
        row[params.get(PARAM_DEST_FIELD)] = res
    return input
1142915
def _x_format(self):
        """"""

        def timedelta_to_str(x):
            td = timedelta(seconds=x)
            return self.x_value_formatter(td)

        return timedelta_to_str
59492
def combine(cls, date, time, tzinfo=None):
    """"""
    if tzinfo is None:
      tzinfo = localtz()
    return cls(datetime.datetime.combine(date, time), tzinfo)
717806
def concat(attrs, inputs, proto_obj):
    
    new_attrs = translation_utils._fix_attribute_names(attrs, {'axis': 'dim'})
    return 'concat', new_attrs, inputs
685170
def TAF_datetime_to_datetime_object(
    datetime_string             = None,
    datetime_for_year_and_month = None  # e.g. datetime.datetime.utcnow()
    ):

    

    if datetime_string.endswith("24"):

        datetime_string = datetime_string[:-2] + "00"

        tmp = datetime.datetime.strptime(datetime_string, "%d%H") +\
              datetime.timedelta(days = 1)

    else:

        tmp = datetime.datetime.strptime(datetime_string, "%d%H")

    return datetime.datetime(
        datetime_for_year_and_month.year,
        datetime_for_year_and_month.month,
        tmp.day,
        tmp.hour,
        tmp.minute
    )
593663
def dict_to_object(self, d):
        
        for k, v in list(d.items()):
            if isinstance(v, six.string_types) and len(v) == 19:
                # Decode a datetime string to a datetime object
                try:
                    d[k] = datetime.strptime(v, "%Y-%m-%dT%H:%M:%S")
                except ValueError:
                    pass
            elif isinstance(v, six.string_types) and len(v) > 20:
                try:
                    d[k] = datetime.strptime(v, "%Y-%m-%dT%H:%M:%S.%f")
                except ValueError:
                    pass
            elif isinstance(v, list):
                d[k] = [self.string_to_datetime(elem) for elem in v]
        return DotDict(d)
987172
@Override
    public Object map(Object input) {
        List<Object> ret = new ArrayList<>();
        Long l = (Long) input;
        for (DerivedColumn d : derivedColumns) {
            switch (d.columnType) {
                case String:
                    ret.add(d.dateTimeFormatter.print(l));
                    break;
                case Integer:
                    DateTime dt = new DateTime(l, inputTimeZone);
                    ret.add(dt.get(d.fieldType));
                    break;
                default:
                    throw new IllegalStateException("Unexpected column type: " + d.columnType);
            }
        }

        return ret;
    }
184348
function addTimeToArrayFromToken(token, input, datePartArray, config) {
        var a, b;

        switch (token) {
        // MONTH
        case 'M' : // fall through to MM
        case 'MM' :
            datePartArray[1] = (input == null) ? 0 : ~~input - 1;
            break;
        case 'MMM' : // fall through to MMMM
        case 'MMMM' :
            for (a = 0; a < 12; a++) {
                if (getLangDefinition().monthsParse[a].test(input)) {
                    datePartArray[1] = a;
                    b = true;
                    break;
                }
            }
            // if we didn't find a month name, mark the date as invalid.
            if (!b) {
                datePartArray[8] = false;
            }
            break;
        // DAY OF MONTH
        case 'D' : // fall through to DDDD
        case 'DD' : // fall through to DDDD
        case 'DDD' : // fall through to DDDD
        case 'DDDD' :
            if (input != null) {
                datePartArray[2] = ~~input;
            }
            break;
        // YEAR
        case 'YY' :
            datePartArray[0] = ~~input + (~~input > 70 ? 1900 : 2000);
            break;
        case 'YYYY' :
            datePartArray[0] = ~~Math.abs(input);
            break;
        // AM / PM
        case 'a' : // fall through to A
        case 'A' :
            config.isPm = ((input + '').toLowerCase() === 'pm');
            break;
        // 24 HOUR
        case 'H' : // fall through to hh
        case 'HH' : // fall through to hh
        case 'h' : // fall through to hh
        case 'hh' :
            datePartArray[3] = ~~input;
            break;
        // MINUTE
        case 'm' : // fall through to mm
        case 'mm' :
            datePartArray[4] = ~~input;
            break;
        // SECOND
        case 's' : // fall through to ss
        case 'ss' :
            datePartArray[5] = ~~input;
            break;
        // MILLISECOND
        case 'S' :
        case 'SS' :
        case 'SSS' :
            datePartArray[6] = ~~ (('0.' + input) * 1000);
            break;
        // TIMEZONE
        case 'Z' : // fall through to ZZ
        case 'ZZ' :
            config.isUTC = true;
            a = (input + '').match(parseTimezoneChunker);
            if (a && a[1]) {
                config.tzh = ~~a[1];
            }
            if (a && a[2]) {
                config.tzm = ~~a[2];
            }
            // reverse offsets
            if (a && a[0] === '+') {
                config.tzh = -config.tzh;
                config.tzm = -config.tzm;
            }
            break;
        }

        // if the input is null, the date is not valid
        if (input == null) {
            datePartArray[8] = false;
        }
    }
729682
def reformat(self, dtstring, before, after):
        
        a_datetime = datetime.strptime(dtstring, before)
        return datetime.strftime(a_datetime, after)