Create a copy of the given example.
964380
def create(example):
    """"""
    try:
        this_dir = os.path.dirname(os.path.realpath(__file__))
        example_dir = os.path.join(this_dir, os.pardir, "examples", example)
        shutil.copytree(example_dir, os.path.join(os.getcwd(), example))
        log("Example created.", delay=0)
    except TypeError:
        click.echo("Example '{}' does not exist.".format(example))
    except OSError:
        click.echo("Example '{}' already exists here.".format(example))
467163
def _generate_examples(self, archive, validation_labels=None):
    """"""
    if validation_labels:  # Validation split
      for example in self._generate_examples_validation(archive,
                                                        validation_labels):
        yield example
    # Training split. Main archive contains archives names after a synset noun.
    # Each sub-archive contains pictures associated to that synset.
    for fname, fobj in archive:
      label = fname[:-4]  # fname is something like 'n01632458.tar'
      # TODO(b/117643231): in py3, the following lines trigger tarfile module
      # to call `fobj.seekable()`, which Gfile doesn't have. We should find an
      # alternative, as this loads ~150MB in RAM.
      fobj_mem = io.BytesIO(fobj.read())
      for image_fname, image_fobj in tfds.download.iter_archive(
          fobj_mem, tfds.download.ExtractMethod.TAR):
        yield {
            'file_name': image_fname,
            'image': image_fobj,
            'label': label,
        }
617390
def copy(defaults={}, context={})
      self.class.find(rpc_execute('copy', id, defaults, context), context: context)
    end
19759
def copy(self):
        """"""
        rv = object.__new__(self.__class__)
        rv.__dict__.update(self.__dict__)
        rv.symbols = self.symbols.copy()
        return rv
80454
def copy(self):
        
        new = self.__class__()
        new.__dict__ = dict(self.__dict__)
        return new
369500
def copy(self):
        """"""
        ret = self.__class__(self.callback, **self.__original_kwargs__)
        return self._ensure_assignment_on_copy(ret)
1265680
def copy(self):
        """"""
        missing = object()
        result = object.__new__(self.__class__)
        for name in self.__slots__:
            val = getattr(self, name, missing)
            if val is not missing:
                setattr(result, name, val)
        return result
604686
def copy(self):
        '''

        '''
        # Significant performance improvements by skipping alphabet check
        return type(self)(self.seq, self.material, run_checks=False)
832770
def save(cls,instance,filename):
        """"""
        filename = cls.correct_file_extension(filename)
        try:
            with open(filename,'wb') as f:
                pickle.dump(instance,f,protocol=pickle.HIGHEST_PROTOCOL)
        except MemoryError as e:
            print ('{} occurred, will downsampled the saved file by 20.'
                   .format(type(e).__name__))
            copy_instance = instance.copy()
            copy_instance.H = copy_instance.H[::20,:,:]
            copy_instance.Y = copy_instance.Y[::20,:]
            with open(filename,'wb') as f:
                pickle.dump(copy_instance,f,protocol=pickle.HIGHEST_PROTOCOL)
784569
def copy(self):
        ""
        other = _ChainedHashAlgorithm(self._algorithms)
        other._hobj = deepcopy(self._hobj)
        other._fobj = deepcopy(self._fobj)
        return other
588732
def copy(self):
        """"""
        data = QMimeData()
        text = '\n'.join([cursor.selectedText() \
                            for cursor in self.cursors()])
        data.setText(text)
        data.setData(self.MIME_TYPE, text.encode('utf8'))
        QApplication.clipboard().setMimeData(data)
240826
public static <I, O> Example<I, O> create(I input, O output) {
    return new Example<I, O>(input, output);
  }
880159
def _generate_examples(self, archive):
    """"""
    prefix_len = len("SUN397")
    with tf.Graph().as_default():
      with utils.nogpu_session() as sess:
        for filepath, fobj in archive:
          if (filepath.endswith(".jpg") and
              filepath not in _SUN397_IGNORE_IMAGES):
            # Note: all files in the tar.gz are in SUN397/...
            filename = filepath[prefix_len:]
            # Example:
            # From filename: /c/car_interior/backseat/sun_aenygxwhhmjtisnf.jpg
            # To class: /c/car_interior/backseat
            label = "/".join(filename.split("/")[:-1])
            image = _process_image_file(fobj, sess, filepath)
            yield {
                "file_name": filename,
                "image": image,
                "label": label,
            }
479852
public ExampleSet copy() {
        ExampleSet copy = new VectorSet();
        for (int i = 0; i < size(); i++)
            copy.add(x(i), y(i), id(i));

        return copy;
    }
359371
def copy(self):
        
        copied = TransformForest()
        copied.base_frame = copy.deepcopy(self.base_frame)
        copied.transforms = copy.deepcopy(self.transforms)

        return copied
1164470
def generate_example(self):
        
        data = javabridge.call(self.jobject, "generateExample", "()Lweka/core/Instance;")
        if data is None:
            return None
        else:
            return Instance(data)
918866
def clone(self):
        
        clone = copy.copy(self)
        clone._unused = clone._unused.clone()
        return clone