Create an author by name, automatically populating the hash.
972001
def from_name(cls, name):
        """"""
        return Author(name=name, sha512=cls.hash_name(name))
31800
def create_user(name, email, datum = nil)
      current_path = '/api/v1/users'
      payload = { name: name, mail: email }
      payload.merge!(datum) unless datum.nil?
      @conn.post(current_path, payload.to_json)
    end
247785
def create_user(self, **kwargs):
        """"""
        kwargs = self._prepare_create_user_args(**kwargs)
        user = self.user_model(**kwargs)
        return self.put(user)
292095
def create_user(self, username, password, tags=""):
        
        path = Client.urls['users_by_name'] % username
        body = json.dumps({'password': password, 'tags': tags})
        return self._call(path, 'PUT', body=body,
                                 headers=Client.json_headers)
74627
def user(context, name, email):
    """"""
    existing_user = context.obj['store'].user(email)
    if existing_user:
        click.echo(existing_user.to_dict())
    elif name:
        new_user = context.obj['store'].add_user(name, email)
        click.echo(click.style(f"New user added: {email} ({new_user.id})", fg='green'))
    else:
        click.echo(click.style('User not found', fg='yellow'))
884473
def __create_author_investigator_str(self):
        
        _author = ""
        try:
            for pub in self.noaa_data_sorted["Publication"]:
                if "author" in pub:
                    if pub["author"]:
                        _author_src = pub["author"]
                        if isinstance(_author_src, str):
                            try:
                                if " and " in _author_src:
                                    _author = _author_src.replace(" and ", "; ")
                                elif ";" in _author_src:
                                    # If there is a semi-colon, add a space after it, just in case it didn't have one
                                    _author = _author_src.replace(";", "; ")
                                break
                            except Exception as e:
                                _author = ""
                        elif isinstance(_author_src, list):
                            try:
                                for _entry in _author_src:
                                    _author += _entry["name"].split(",")[0] + ", "
                            except Exception as e:
                                _author = ""
        except Exception:
            _author = ""
        return _author
614180
private function setAuthorData()
    {
        $this->Author = trim($this->Author);
        $nameParts = explode(' ', $this->Author);
        foreach ($nameParts as $key => $namePart) {
            if ($namePart === '') {
                unset($nameParts[$key]);
            }
        }
        $this->Author = implode(' ', $nameParts);
        /** @var AuthorHelper $author */
        $author = AuthorHelper::get()->filter('OriginalName', trim($this->Author));
        if (!$author->Count()) {
            $author = AuthorHelper::create();
            $author->OriginalName = trim($this->Author);
            $author->write();
        } else {
            $author = $author->first();
        }
        $this->AuthorHelperID = $author->ID;
    }
287675
def search_by_name(cls, name):
        
        records = aleph.downloadRecords(
            aleph.searchInAleph("aut", name, False, "wau")
        )

        for record in records:
            marc = MARCXMLRecord(record)

            author = cls.parse_author(marc)

            if author:
                yield author
302249
def add_author_year(string) # :yields: Array of Taxonifi::Model::Person
      auth_yr = Taxonifi::Splitter::Builder.build_author_year(string)
      @year = auth_yr.year
      @authors = auth_yr.people
    end
107223
def user_create(self, data, **kwargs):
        ""
        api_path = "/api/v2/users.json"
        return self.call(api_path, method="POST", data=data, **kwargs)
393215
function(userObj, setname, hashPrefix, cb){
      
      console.log("\nCreating new user account %s", userObj.network.username)
      
      /*
      userObj = {
        network: {
          type : 'facebook',
          first_name: 'Joe',
          last_name: 'McCann',
          username: 'joemccann',
          full_name: 'Joe McCann'
        },
        email_address: 'joseph.isaac@gmail.com',
        oauth: {}
      }
      */
      
      // TODO: CHECK IF HASH EXISTS

      // Schema should be:
      var schema = 
      {
        uuid: null,
        networks: { 
          twitter: {},
          facebook: {},
          instagram: {},
          flickr: {},
          dropbox: {},
          google_drive: {}
        },
        email_addresses: [],
        cache: {
          twitter: null,
          facebook: null,
          instagram: null,
          flickr: null,
          dropbox: null,
          google_drive: null
        }
      }

      // Generate unique user id
      schema.uuid = sha1(redisConfig.salt, userObj.email_address)

      // "Official" email address is schema.email_addresses[0]
      // Add it to the email addresses for the user
      schema.email_addresses.push(userObj.email_address)

      // Let's 
      client.sadd(setname, schema.uuid, function(e,d){

        if(cb){
          return cb(e,d)
        } 
        
        userSetAddHandler(e,d)

        client.hmset(hashPrefix +":"+schema.uuid, userObj, hmsetCb || userSetHashHandler)
        
      })

    }
908479
def personByName(self, name):
        
        return self.store.findOrCreate(Person, organizer=self, name=name)
1201153
def to_author
      author = Author.new
      author.name = self.name
      author.email = self.email unless self.email.nil?
      author.uri = self.uri unless self.uri.nil?
      author
    end
574285
def set_author(self, **kwargs):
        
        self.author = {
            'name': kwargs.get('name'),
            'url': kwargs.get('url'),
            'icon_url': kwargs.get('icon_url'),
            'proxy_icon_url': kwargs.get('proxy_icon_url'),
        }
693373
def make_mine(self, request, queryset):
        
        author = Author.objects.get(pk=request.user.pk)
        for entry in queryset:
            if author not in entry.authors.all():
                entry.authors.add(author)
        self.message_user(
            request, _('The selected entries now belong to you.'))
205048
def create_book(self, name):
        """"""
        name = name.strip()
        if not len(name):
            self.error("Cannot have a blank book name")
        # The next could be relaxed, if users want commas in book names, but
        # I prefer to keep it, in case later there could be a syntax for multiple
        # book names, using comma.
        if name.find(",") >= 0:
            self.error("Cannot have a ',' in a book name")
        existing = self.list_books()
        nexisting = len(existing)
        if name in existing:
            self.error("Already have a book named '%s'" % name)
        try:
            self.cur.execute("INSERT INTO book (number, name) VALUES(?, ?);", (nexisting, name))
            self.con.commit()
        except:
            self.fyi("Error adding a book named '%s'" % name)
1064256
def perform_create(self, serializer):
        """"""
        with transaction.atomic():
            instance = serializer.save()

            # Assign all permissions to the object contributor.
            assign_contributor_permissions(instance)