VJ: copy from MethodsHelper
492133
public static IdentifierTree methodName(MethodInvocationTree mit) {
	    IdentifierTree id;
	    if (mit.methodSelect().is(Tree.Kind.IDENTIFIER)) {
	      id = (IdentifierTree) mit.methodSelect();
	    } else {
	      id = ((MemberSelectExpressionTree) mit.methodSelect()).identifier();
	    }
	    return id;
	  }
4420
private static Object _runMethod(Object obj, String methodName)
    {
        try
        {
            Method sessionIdMethod = obj.getClass().getMethod(methodName);
            return sessionIdMethod.invoke(obj);
        }
        catch (Exception e)
        {
            return null;
        }

    }
1217271
function copy(from, to) {
      var name;
      for (name in from) {
        if (from.hasOwnProperty(name)) {
          to[name] = from[name];
        }
      }
    }
159941
@SuppressWarnings({ "unchecked", "rawtypes" })
    public static void copyExpandoMetaClass(Class<?> fromClass, Class<?> toClass, boolean removeSource) {

        MetaClassRegistry registry = getRegistry();

        MetaClass oldMetaClass = registry.getMetaClass(fromClass);

        AdaptingMetaClass adapter = null;
        ExpandoMetaClass emc;

        if (oldMetaClass instanceof AdaptingMetaClass) {
            adapter = ((AdaptingMetaClass)oldMetaClass);
            emc = (ExpandoMetaClass)adapter.getAdaptee();
            if (LOG.isDebugEnabled()) {
                LOG.debug("Obtained adapted MetaClass ["+emc+"] from AdapterMetaClass instance ["+adapter+"]");
            }

            if (removeSource) {
                registry.removeMetaClass(fromClass);
            }
        }
        else {
            emc = (ExpandoMetaClass)oldMetaClass;
            if (LOG.isDebugEnabled()) {
                LOG.debug("No adapter MetaClass found, using original ["+emc+"]");
            }
        }

        ExpandoMetaClass replacement = new ExpandoMetaClass(toClass, true, true);

        for (Object obj : emc.getExpandoMethods()) {
            if (obj instanceof ClosureInvokingMethod) {
                ClosureInvokingMethod cim = (ClosureInvokingMethod) obj;
                Closure callable = cim.getClosure();
                if (!cim.isStatic()) {
                    replacement.setProperty(cim.getName(), callable);
                }
                else {
                    ((GroovyObject)replacement.getProperty(ExpandoMetaClass.STATIC_QUALIFIER)).setProperty(cim.getName(),callable);
                }
            }
        }

        for (Object o : emc.getExpandoProperties()) {
            if (o instanceof ThreadManagedMetaBeanProperty) {
                ThreadManagedMetaBeanProperty mbp = (ThreadManagedMetaBeanProperty)o;
                replacement.setProperty(mbp.getName(), mbp.getInitialValue());
            }
        }
        replacement.initialize();

        if (adapter == null) {
            if (LOG.isDebugEnabled()) {
                LOG.debug("Adding MetaClass for class ["+toClass+"] MetaClass ["+replacement+"]");
            }
            registry.setMetaClass(toClass, replacement);
        }
        else {
            if (LOG.isDebugEnabled()) {
                LOG.debug("Adding MetaClass for class [" + toClass + "] MetaClass [" + replacement +
                        "] with adapter [" + adapter + "]");
            }
            try {
                Constructor c = adapter.getClass().getConstructor(new Class[]{MetaClass.class});
                MetaClass newAdapter = (MetaClass) BeanUtils.instantiateClass(c,new Object[]{replacement});
                registry.setMetaClass(toClass,newAdapter);
            }
            catch (NoSuchMethodException e) {
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Exception thrown constructing new MetaClass adapter when reloading: " + e.getMessage(),e);
                }
            }
        }
    }
293254
public static void copy(Object src, Object target) throws BeanMappingException {
        BeanCopy copy = BeanCopy.create(src.getClass(), target.getClass());
        copy.copy(src, target);
    }
40307
function copyJS() {
    let tasks = [];
    Object.keys(config).forEach((key) => {
        let val = config[key];
        tasks.push(gulp.src(val.src).pipe(gulp.dest(val.dest)));
    });

    return merge(tasks);
}
706492
private static void copy(Class<?> toType, Object to, Object... from) {
        int f = 0, fi = 0,
            length = Array.getLength(from[0]),
            total = from.length > 1 ? Array.getLength(to) : length;
        if ( Types.arrayDimensions(to.getClass()) == 1 ) {
            for ( int i = 0; i < total; i++ ) {
                Object value = Array.get(from[f], fi++);
                try {
                    value = Primitive.unwrap(
                            Types.castObject(value, toType, Types.CAST));
                } catch (UtilEvalError e) { /* ignore cast errors */ }
                if ( Byte.TYPE == toType )
                    Array.setByte(to, i, (byte) value);
                else if ( Short.TYPE == toType )
                    Array.setShort(to, i, (short) value);
                else if ( Integer.TYPE == toType )
                    Array.setInt(to, i, (int) value);
                else if ( Long.TYPE == toType )
                    Array.setLong(to, i, (long) value);
                else if ( Float.TYPE == toType )
                    Array.setFloat(to, i, (float) value);
                else if ( Double.TYPE == toType )
                    Array.setDouble(to, i, (double) value);
                else if ( Character.TYPE == toType )
                    Array.setChar(to, i, (char) value);
                else if ( Boolean.TYPE == toType )
                    Array.setBoolean(to, i, (boolean) value);
                else
                    Array.set(to, i, value);

                // concatenate multiple from arrays
                if ( length < total && fi == length && f+1 < from.length ) {
                    length = Array.getLength(from[++f]);
                    fi = 0;
                }
            }
        } else for ( int i = 0; i < total; i++ ) {
            // concatenate multiple from arrays
            if ( length < total && fi == length && f+1 < from.length ) {
                length = Array.getLength(from[++f]);
                fi = 0;
            }

            Object frm = Array.get(from[f], fi++);

            // null dimension example: new Integer[2][]
            if ( null == frm ) {
                Array.set(to, i, null);
                continue;
            }

            Object tto = Array.get(to, i);

            // mixed array lengths in multiple dimensions ex: {{1,2}, {3}}
            if ( Array.getLength(frm) != Array.getLength(tto) )
                Array.set(to, i,
                    tto = Array.newInstance(toType, dimensions(frm)));

            // recurse copy for next array dimension
            copy(toType, tto, frm);
        }
    }
896720
function copy (from, to) {
  return Object.assign(
    function (context) {
      return function (prevConfig) {
        context.copyPlugin = context.copyPlugin || {patterns: []}

        // Merge the provided simple pattern into the config
        context.copyPlugin = _extends({}, context.copyPlugin, {
          patterns: [].concat(context.copyPlugin.patterns, [
            {from: from, to: to},
          ]),
        })

        // Don't alter the config yet
        return prevConfig
      }
    },
    {post: postConfig}
  )
}
1062162
function copyFunction(original)
{
  // clone original function
  var target = fulcon(original);

  // copy it's "static" methods
  copy(target, original);
  // duplicate prototype methods
  copy(target.prototype, original.prototype);

  // add instance reference to the it's own constructor
  Object.defineProperty(target.prototype, 'constructor', {
    value       : target,
    writable    : true,
    enumerable  : false,
    configurable: true
  });

  return target;
}
963532
private ImmutableList<String> copyAnnotations(
      Element autoValueType, Element typeOrMethod, Set<String> excludedAnnotations) {
    ImmutableList<AnnotationMirror> annotationsToCopy =
        annotationsToCopy(autoValueType, typeOrMethod, excludedAnnotations);
    return annotationStrings(annotationsToCopy);
  }
755176
private <D,S> JMapper<D,S> getJMapper(HashMap<String,JMapper> map,Object source){
		Class<?> sourceClass = source instanceof Class?((Class<?>)source):source.getClass();
		JMapper<D,S> jMapper = map.get(sourceClass.getName());
		if(jMapper == null) Error.classNotMapped(source, configuredClass);
		return jMapper;
	}
446224
@SuppressWarnings("unchecked")
    ViewQueryParameters<K, V> copy() {
        try {
            return (ViewQueryParameters<K, V>) this.clone();
        } catch (CloneNotSupportedException e) {
            //should not reach this code as this class implements Cloneable
            throw new RuntimeException(e);
        }
    }
1007324
public void copyDocumentationTo(/* @Nullable */ final EObject source, /* @Nullable */ JvmIdentifiableElement jvmElement) {
		if(source == null || jvmElement == null)
			return;
		
		DocumentationAdapter documentationAdapter = new DocumentationAdapter() {
			private boolean computed = false;
			@Override
			public String getDocumentation() {
				if (computed) {
					return super.getDocumentation();
				}
				String result = JvmTypesBuilder.this.getDocumentation(source);
				setDocumentation(result);
				return result;
			}
			@Override
			public void setDocumentation(String documentation) {
				computed = true;
				super.setDocumentation(documentation);
			}
		};
		jvmElement.eAdapters().add(documentationAdapter);
	}
1193468
@Requires({
    "method != null",
    "parameters != null",
    "!parameters.contains(null)"
  })
  public static void copyParameters(MethodModel method,
                                    List<? extends VariableModel> parameters) {
    ArrayList<VariableModel> list = new ArrayList<VariableModel>(parameters);
    for (VariableModel param : list) {
      method.addParameter(new VariableModel(param));
    }
  }
805770
public static void copyProperty(Object bean, String name, Object value)
            throws Excel4JException {

        if (null == name || null == value)
            return;
        Field field = matchClassField(bean.getClass(), name);
        if (null == field)
            return;
        Method method;
        try {
            method = getterOrSetter(bean.getClass(), name, FieldAccessType.SETTER);

            if (value.getClass() == field.getType()) {
                method.invoke(bean, value);
            } else {
                method.invoke(bean, str2TargetClass(value.toString(), field.getType()));
            }
        } catch (IntrospectionException | IllegalAccessException | InvocationTargetException e) {
            throw new Excel4JException(e);
        }

    }
251570
private void createProxyJsMethod(Builder componentExposedTypeBuilder,
      ExecutableElement originalMethod, String proxyMethodName) {
    Emit emitAnnotation = originalMethod.getAnnotation(Emit.class);

    MethodSpec.Builder proxyMethodBuilder = MethodSpec
        .methodBuilder(proxyMethodName)
        .addModifiers(Modifier.PUBLIC)
        .addAnnotation(JsMethod.class)
        .addAnnotation(getUnusableByJSAnnotation())
        .returns(ClassName.get(originalMethod.getReturnType()));

    originalMethod
        .getParameters()
        .forEach(parameter -> proxyMethodBuilder.addParameter(TypeName.get(parameter.asType()),
            parameter.getSimpleName().toString()));

    String methodCallParameters = getSuperMethodCallParameters(originalMethod);
    boolean hasReturnValue = !"void".equals(originalMethod.getReturnType().toString());
    if (hasReturnValue) {
      proxyMethodBuilder.addStatement("$T result = super.$L($L)",
          originalMethod.getReturnType(),
          originalMethod.getSimpleName().toString(),
          methodCallParameters);
    } else {
      proxyMethodBuilder.addStatement("super.$L($L)",
          originalMethod.getSimpleName().toString(),
          methodCallParameters);
    }

    if (emitAnnotation != null) {
      addEmitEventCall(originalMethod, proxyMethodBuilder, methodCallParameters);
    }

    if (hasReturnValue) {
      proxyMethodBuilder.addStatement("return result");
    }

    componentExposedTypeBuilder.addMethod(proxyMethodBuilder.build());
  }
485535
def copy(self):
        """"""
        # This way of initializing the copy means it works for subclasses, too.
        obj = self.__class__(self)
        obj.keyOrder = self.keyOrder[:]
        return obj