text
string
size
int64
token_count
int64
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class KbAdvertSettleBillResponse(object): def __init__(self): self._download_url = None self._paid_date = None @property def download_url(self): return self._download_u...
1,423
470
# -*- coding: utf-8 -*- """ Created on Mon Dec 2 11:06:59 2019 @author: Paul """ def read_data(filename): """ Reads csv file into a list, and converts to ints """ data = [] f = open(filename, 'r') for line in f: data += line.strip('\n').split(',') ...
6,356
2,362
from django.db import models # Create your models here. class Schema(models.Model): name = models.CharField(max_length=200) description = models.TextField() class Code(models.Model): name = models.CharField(max_length=200) description = models.TextField() active_instances = models.Posit...
3,333
1,007
# -*- coding: utf-8 -*- # Copyright 2019 Open End AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
8,079
2,492
""" Copyright 2020 InfAI (CC SES) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in...
1,455
439
# Generated by Django 3.2.3 on 2021-05-27 13:34 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('user_profile', '0002_auto_20210526_1747'), ] operations = [ migrations.AddField( model_name='order', name='payment_m...
462
169
#!/usr/bin/env python import unittest from day07 import has_abba, get_abba_allowed_strings, get_abba_disallowed_strings from day07 import supports_tls, count_tls_addresses from day07 import find_abas, supports_ssl, count_ssl_addresses class TestFindingABBASequences(unittest.TestCase): cases = ( ('abba', ...
2,522
913
import torch import numpy as np import torch.nn.functional as F from torch.autograd import Variable from basenets.MLP import MLP from basenets.Conv import Conv from torch import nn class FCPG_Gaussian(MLP): def __init__(self, n_inputfeats, n_actions, sigma, ...
4,787
1,384
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
10,057
3,622
""" Copyright 2015 Rackspace Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software dist...
50,485
13,563
# (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import os import pytest from datadog_checks.dev import docker_run from datadog_checks.dev.conditions import CheckDockerLogs from datadog_checks.dev.subprocess import run_command from .common import BAS...
1,412
483
import json from typing import Dict, Optional import requests from federation.hostmeta.parsers import ( parse_nodeinfo_document, parse_nodeinfo2_document, parse_statisticsjson_document, parse_mastodon_document, parse_matrix_document, parse_misskey_document) from federation.utils.network import fetch_document ...
3,025
954
import numpy as np from typing import Any, Dict, List, Tuple, NoReturn import argparse import os def parse_arguments() -> Any: """Parse command line arguments.""" parser = argparse.ArgumentParser() parser.add_argument( "--data_dir", default="", type=str, help="Directory where the features (npy files) a...
2,582
1,221
# -*- encoding: utf-8 -*- # Copyright (c) 2017 Servionica # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
2,916
859
# https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/ # # Say you have an array for which the ith element is the price of a given stock on day i. # # Design an algorithm to find the maximum profit. # You may complete as many transactions as you like (ie, buy one and sell one share of the stock multiple ti...
1,422
435
import json import os import responses from django.urls import reverse from .. import TestAdminMixin, TestLociMixin class BaseTestAdmin(TestAdminMixin, TestLociMixin): geocode_url = 'https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/' def test_location_list(self): self._login_as_a...
7,787
2,421
import torch from torch import nn from torch.nn.parameter import Parameter from einops import rearrange, reduce, repeat class dca_offsets_layer(nn.Module): """Constructs a Offset Generation module. """ def __init__(self, channel, n_offsets): super(dca_offsets_layer, self).__init__() self....
1,270
454
from . import test_helpers from . import test_image_opener from . import test_image_metrick from . import test_compare_tools from . import test_compare_api
155
46
from django.contrib import admin from django.urls import path from .views import index, email, post_detail, posts, hot_takes, take_detail from . import views app_name = "core" urlpatterns = [ path('',views.index,name="index"), path('email/',views.email,name="email"), path('post/<slug>/',views.post_detail,...
485
163
from .grid import render_table
30
8
from mongoengine import * from dotenv import load_dotenv from os import getenv from cassandra.cluster import Cluster from cassandra.auth import PlainTextAuthProvider from cassandra.cqlengine import connection from cassandra.cqlengine.management import sync_table from cassandra.query import ordered_dict_factory from mod...
1,573
483
# stdlib import importlib import sys from typing import Any from typing import Any as TypeAny from typing import Dict as TypeDict from typing import Optional # third party from packaging import version # syft relative from ..ast.globals import Globals from ..lib.python import create_python_ast from ..lib.torch import...
3,921
1,196
#!/usr/bin/env python # coding: utf-8 # In[ ]: import pysam import os import pandas as pd import numpy as np import time import argparse import sys from multiprocessing import Pool # In[ ]: # ##arguments for testing # bam_file_path = '/fh/scratch/delete90/ha_g/realigned_bams/cfDNA_MBC_ULP_hg38/realign_bam_pa...
8,742
2,999
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Mar 1 18:17:07 2021 @author: jm """ # %% required libraries import numpy as np import pandas as pd from sqlalchemy import create_engine # %% connect to DB # create connection using pymssql engine = create_engine('mssql+pymssql://sa:<YourStrong@Passw...
4,372
1,510
import discord from discord.ext import commands arrow = "<a:right:877425183839891496>" kwee = "<:kannawee:877036162122924072>" kdance = "<a:kanna_dance:877038778798207016>" kbored = "<:kanna_bored:877036162827583538>" ksmug = "<:kanna_smug:877038777896427560>" heart = "<a:explosion_heart:877426228775227392>" class Se...
6,897
2,336
for ch in "Hello world!": d = ord(ch) h = hex(d) o = oct(d) b = bin(d) print ch, d, h, o, b
109
56
# Copyright (c) 2016 Roger Light <roger@atchoo.org> # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # and Eclipse Distribution License v1.0 which accompany this distribution. # # The Eclipse Public License is available at # ...
10,016
2,793
from collections import defaultdict def solution(): starting_components = d[0] best_scores = [] for component in starting_components: n_a, n_b = get_ports(component) nxt_port = n_a if n_b == 0 else n_b best_scores.append(recurse(component, set(), nxt_port, 0)) print("fuck", max...
1,561
582
import numpy as np import network def main(): x = np.array([2, 3]) nw = network.NeuralNetwork() print(nw.feedforward(x)) if __name__ == "__main__": main()
175
68
#draw the predictions from real-time.py import matplotlib.pyplot as plt import matplotlib.animation as animation from matplotlib import style style.use('fivethirtyeight') fig = plt.figure() ax1 = fig.add_subplot(1,1,1) def animate(i): graph_data = open('emotion.txt', 'r').read() lines = graph_data.split('\n'...
1,048
397
""" Code to load a policy and generate rollout data. Adapted from https://github.com/berkeleydeeprlcourse. Example usage: python run_policy.py ../trained_policies/Humanoid-v1/policy_reward_11600/lin_policy_plus.npz Humanoid-v1 --render \ --num_rollouts 20 """ import numpy as np import gym def main():...
1,850
596
""" Generates Tisserand plots """ from enum import Enum import numpy as np from astropy import units as u from matplotlib import pyplot as plt from poliastro.plotting._base import BODY_COLORS from poliastro.twobody.mean_elements import get_mean_elements from poliastro.util import norm class TisserandKind(Enum): ...
6,048
1,945
from KeyValueTree import KeyValueTree from truth.models import KeyValue as TruthKeyValue, Truth from systems.models import KeyValue as KeyValue from django.test.client import RequestFactory from api_v2.keyvalue_handler import KeyValueHandler import json factory = RequestFactory() class Rack: rack_name = None ...
3,122
974
from .trim import trim from .sample import sample from .sort import sort function_map = { 'trim': trim, 'sample': sample, 'sort': sort }
151
49
from .nirspec import divspec from .nirspec import gluespec
59
20
from __future__ import absolute_import from __future__ import print_function import datetime import os import random import sys import uuid import base64 import yaml import re try: import en except: print("DOWNLOD NODECUBE") print("""wget https://www.nodebox.net/code/data/media/linguistics.zip unzip lingui...
9,526
2,815
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
3,927
1,170
#!/usr/bin/env python import argparse import CppHeaderParser import re import sys import yaml import copy import six import os.path import traceback class CppDefine(dict): def __init__(self): self["name"] = None self["parameters"] = [] self["line_number"] = -1 class CppDefineParameter(dic...
20,346
5,585
import typing as t from http.server import HTTPServer, BaseHTTPRequestHandler from . import response as resp class WsgiServer(HTTPServer): pass class WsgiHandel(BaseHTTPRequestHandler): def handle(self) -> None: handle_response = SimpleHandler(self.wfile) handle_response.send() class Sim...
1,527
527
#!/usr/bin/env python3 from fairseq.modules import multihead_attention as fair_multihead from pytorch_translate.attention import ( BaseAttention, attention_utils, register_attention, ) @register_attention("multihead") class MultiheadAttention(BaseAttention): """ Multiheaded Scaled Dot Product At...
4,462
1,447
"""Support for Purrsong LavvieBot S""" import asyncio import logging import voluptuous as vol from lavviebot import LavvieBotApi import homeassistant.helpers.config_validation as cv from homeassistant import config_entries from homeassistant.const import EVENT_HOMEASSISTANT_STOP from homeassistant.exceptions import Co...
1,102
358
class Rectangle: """A rectangle shape that can be drawn on a Canvas object""" def __init__(self, x, y, width, height, color): self.x = x self.y = y self.width = width self.height = height self.color = color def draw(self, canvas): """Draws itself into the Ca...
917
285
from mars import main_loop import numpy as np from mars.settings import * class Problem: """ Synopsis -------- User class for the Kelvin-Helmholtz instability Args ---- None Methods ------- initialise Set all variables in each cell to initialise the simulation. i...
2,904
1,047
# -*- coding: utf-8 -*- """ Check if it is Thai text """ import string _DEFAULT_IGNORE_CHARS = string.whitespace + string.digits + string.punctuation def isthaichar(ch: str) -> bool: """ Check if a character is Thai เป็นอักษรไทยหรือไม่ :param str ch: input character :return: True or False "...
1,461
538
print(b) print(c) print(d) print(e) print(f) print(g)
54
32
import numpy as np from scipy.signal import savgol_filter import matplotlib.pyplot as plt import MadDog x = [] y = [] def generate(): # Generate random data base = np.linspace(0, 5, 11) # base = np.random.randint(0, 10, 5) outliers = np.random.randint(10, 20, 2) data = np.concatenate((base, outli...
1,941
827
#!/usr/bin/python # # Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
8,087
2,536
import pytest from pyminhash import MinHash from pyminhash.datasets import load_data def test__sparse_vector(): df = load_data() myMinHasher = MinHash(10) res = myMinHasher._sparse_vectorize(df, 'name') assert res.columns.tolist() == ['name', 'sparse_vector'] assert res['sparse_vector'].dtype == ...
2,001
793
from datetime import datetime, timedelta from typing import final from tools import localize_time RSS_URL_PREFIX: final = 'https://www.youtube.com/feeds/videos.xml?channel_id={0}' LOCATION_ARGUMENT_PREFIX: final = '--location=' CHANNEL_ARGUMENT_PREFIX: final = '--channels=' LAST_CHECK_ARGUMENT_PREFIX: final = '--last...
503
203
# SPDX-License-Identifier: BSD-3-Clause from amaranth import Elaboratable, Module, Signal, ResetInserter, EnableInserter __all__ = ( 'PIC16Caravel', ) class PIC16Caravel(Elaboratable): def elaborate(self, platform): from .pic16 import PIC16 from .soc.busses.qspi import QSPIBus m = Module() reset = Signal() ...
1,325
651
from discord.ext import commands import discord class Stats(commands.Cog): def __init__(self, bot): self.bot = bot @commands.command() @commands.has_permissions(manage_channels=True) async def stats(self, ctx): members = await ctx.guild.fetch_members(limit=None).flatten() mem...
2,615
762
from mrs.bucket import WriteBucket from mrs import BinWriter, HexWriter def test_writebucket(): b = WriteBucket(0, 0) b.addpair((4, 'test')) b.collect([(3, 'a'), (1, 'This'), (2, 'is')]) values = ' '.join(value for key, value in b) assert values == 'test a This is' b.sort() values = ' '.j...
2,995
1,081
""" An agent which uses demonstrations and preferences. Code adapted from Learning Reward Functions by Integrating Human Demonstrations and Preferences. """ import itertools import os import time from pathlib import Path from typing import Dict, List import arviz as az from inquire.agents.agent import Agent from inq...
35,783
9,124
"""This module contains all public learners and learner interfaces.""" from coba.learners.primitives import Learner, SafeLearner from coba.learners.bandit import EpsilonBanditLearner, UcbBanditLearner, FixedLearner, RandomLearner from coba.learners.corral import CorralLearner from coba.learners.vowpal impo...
1,049
415
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and ...
24,347
7,072
# Copyright (c) 2010-2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
11,719
3,468
import resource_files resources = resource_files.ResourceFiles() # sample use case of getting yamls print(resources.get_yaml("Pod", "jumpy-shark-gbapp-frontend-844fdccf55-ggkbf", "default", "mycluster")) # sample use case of getting events print(resources.get_events('mycluster','default','78abd8c9-ac06-11e9-b68f-0e7...
474
182
""" Project: flask-rest Author: Saj Arora Description: Handle auth endpoints such as auth/signup, auth/login """ from api.v1 import make_json_ok_response, SageController, SageMethod from api.v1.fundamentals import helper from .auth_controller import AuthController def sage_auth_signup_function(self, resource, **kwarg...
1,305
379
import random as rn import numpy as np # open system dynamics of a qubit and compare numerical results with the analytical calculations # NOTE these are also TUTORIALS of the library, so see the Tutorials for what these are doing and analytical # calculations. # currently includes 2 cases: (i) decay only, and (ii) un...
1,785
545
#this file will contain function that related to vector state from .density import * #we may use some functions from them and dependencies def row2col(vec): if np.ndim(vec)==1: col=[] for element in vec: col.append([element]) return col else: return vec def che...
538
159
#! /usr/bin/env python """ Description: Gather Metadata for the uncover-ml prediction output results: Reference: email 2019-05-24 Overview Creator: (person who generated the model) Model; Name: Type and date: Algorithm: Extent: Lat/long - location on Australia map? SB Notes: None of the above is r...
4,480
1,348
print("hiiiiiiiiiiiiiiiix") def sayhi(): print("2nd pkg said hi")
72
32
import numpy as np import pandas as pd from pandas.util import testing as tm class algorithm(object): goal_time = 0.2 def setup(self): N = 100000 self.int_unique = pd.Int64Index(np.arange(N * 5)) # cache is_unique self.int_unique.is_unique self.int = pd.Int64Index(np...
2,447
928
#!/usr/bin/env python #=============================================================================# # # # NAME: do_RMsynth_1D.py # # ...
28,857
9,317
from .message_passing import MessagePassing from .gcn_conv import GCNConv from .gat_conv import GATConv from .se_layer import SELayer from .aggregator import Meanaggregator from .maggregator import meanaggr __all__ = [ 'MessagePassing', 'GCNConv', 'GATConv', 'SELayer', 'Meanaggregator' ]
310
109
# Copyright 2021 The NetKet Authors - All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
1,449
460
# coding=utf-8 import ee from . import utils import json import csv from .. import tools def fromShapefile(filename, crs=None, start=None, end=None): """ Convert an ESRI file (.shp and .dbf must be present) to a ee.FeatureCollection At the moment only works for shapes with less than 1000 records and does...
10,933
3,301
# Rock-paper-scissors-lizard-Spock template # The key idea of this program is to equate the strings # "rock", "paper", "scissors", "lizard", "Spock" to numbers # as follows: # # 0 - rock # 1 - Spock # 2 - paper # 3 - lizard # 4 - scissors import random def name_to_number(name): if name == "rock": return ...
1,357
482
""" Contains functions to generate and combine a clustering ensemble. """ import numpy as np import pandas as pd from sklearn.metrics import pairwise_distances from sklearn.metrics import adjusted_rand_score as ari from sklearn.metrics import adjusted_mutual_info_score as ami from sklearn.metrics import normalized_mutu...
9,067
2,438
import logging from django.db import transaction, connection from django.utils import timezone from django.utils.timezone import localtime from chart.application.enums.department_type import DepartmentType from chart.application.enums.gender_type import GenderType from chart.application.service.app_logic_base import ...
7,236
2,419
from flask import render_template def home(): return render_template('upload.html') def about(): return render_template('about.html')
146
42
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file '.\hastakayit_gui.ui' # # Created by: PyQt5 UI code generator 5.11.3 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets import mysql.connector from PyQt5.QtWidgets import QMessageBox,QWidget,Q...
5,761
2,225
#!/usr/bin/env python3 ''' Copyright (c) 2021, Collins Aerospace. Developed with the sponsorship of Defense Advanced Research Projects Agency (DARPA). Permission is hereby granted, free of charge, to any person obtaining a copy of this data, including any software or models in source or binary form, as well as any d...
4,138
1,355
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ Test components of specific crowdsourcing tasks. """ import json import os import unittest import pandas as pd imp...
5,743
1,463
def example_selector(*args, **kwargs): return "default"
57
17
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Chatham Financial <oss@chathamfinancial.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3...
3,937
1,189
# Copyright 2016 - Nokia, ZTE # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
7,279
2,065
import numpy as np class Mesh: """Contains meshses of shapes that will ultimately get rendered. Attributes ---------- vertices : np.ndarray Qx2 array of vertices of all triangles for shapes including edges and faces vertices_centers : np.ndarray Qx2 array of centers of ...
2,406
681
import sys def start_parameter(text, i): if len(sys.argv) > i: print('{0}{1}'.format(text, sys.argv[i])) return float(sys.argv[i]) else: return float(raw_input(text))
184
73
#!/usr/bin/python3 # vim:se tw=0 sts=4 ts=4 et ai: """ Copyright © 2014 Osamu Aoki Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to u...
12,916
3,601
from django.core.exceptions import NON_FIELD_ERRORS from rest_framework import status, viewsets, serializers from rest_framework.decorators import list_route from rest_framework.response import Response from rest_framework.serializers import ModelSerializer from jet_django.filters.model_aggregate import AggregateFilte...
6,164
1,733
""" Weather functions. """ from ursina import color, window, time from nMap import nMap class Weather: def __init__(this, rate=1): this.red = 0 this.green = 200 this.blue = 211 this.darkling = 0 this.rate = rate this.towardsNight = 1 def setSky(this): ...
779
286
#!/usr/bin/env python3 ''' Copyright 2016 Dave Fancella Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicab...
8,086
2,159
# Generated by Django 2.2.7 on 2019-11-17 17:19 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('account', '0002_remove_customuser_full_name'), ] operations = [ migrations.AddField( model_name='customuser', name='...
416
141
base = int(input('Digite o valor da base: ')) expoente = 0 while expoente <= 0: expoente = int(input('Digite o valor do expoente: ')) if expoente <= 0: print('O expoente tem que ser positivo') potencia = 1 for c in range(1, expoente + 1): potencia *= base print(f'{base}^ {expoente} = {potencia}'...
322
129
# -*- coding: utf-8 -*- # Copyright (c) 2021, Noah Jacob and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document from frappe.utils import flt from accounting.accounting.general_ledger import make_gl_entry, make_...
1,313
497
from django.db import models # Create your models here. # 클래스의 기능: 상속 class Question(models.Model): # Table question_text= models.CharField(max_length= 100) # column, datatype public_date= models.CharField(max_length= 100) votes= models.DecimalField(max_digits= 20, decimal_places= 10) # 위의 2개 타입으로 클래스 만들면 ...
568
248
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys,os,time if len(sys.argv)<2: print "usage: test_snap.py <check|show>" sys.exit(2) kam_cmd=sys.argv[1] path='/var/data2/snap_store' a=os.listdir(path) a.remove('535e1a5c1ecffb2fa372fd7d') # this is a camera not used in HF system if kam_cmd=='show' or kam_cm...
722
377
import functools import gc from abc import ABC from sources.datasets.client_dataset_definitions.client_dataset_loaders.client_dataset_loader import ClientDatasetLoader, DatasetComponents from sources.datasets.client_dataset_definitions.client_dataset_processors.client_dataset_processor import ClientDatasetProcessor fr...
5,608
1,493
import logging import numpy import kgprim.motions as motions import kgprim.ct.frommotions as frommotions import kgprim.ct.repr.mxrepr as mxrepr import motiondsl.motiondsl as motdsl logger = logging.getLogger(__name__) class RobotKinematics: '''The composition of the constant poses and the joint poses of a robot....
2,377
754
# Copyright (c) 2015 Ansible, Inc. # All Rights Reserved. import os import logging from multiprocessing import Process from django.conf import settings from django.core.cache import cache as django_cache from django.core.management.base import BaseCommand from django.db import connection as django_connection from komb...
4,702
1,253
import numpy as np import torch from . import common_utils class ResidualCoder(object): def __init__(self, code_size=7): super().__init__() self.code_size = code_size @staticmethod def encode_np(boxes, anchors): """ :param boxes: (N, 7 + ?) x, y, z, w, l, h, r, custom valu...
5,318
2,127
""" Utilities for learning pipeline.""" from __future__ import print_function import copy import dill import hashlib import itertools import third_party.deep_bingham.bingham_distribution as ms import math import numpy as np import os import scipy import scipy.integrate as integrate import scipy.special import sys impor...
15,175
5,142
import requests import os from PyInquirer import style_from_dict, Token, prompt import sys import utils.config as config import utils.ends as ends from utils.colorfy import * from auto.testing import test_trans import time import json style = style_from_dict({ Token.QuestionMark: '#E91E63 bold', Token.Selected: '#673...
8,108
3,267
# -*- coding: utf-8 -*- from maya import mel from maya import cmds from . import lang from . import common import os import json import re class WeightCopyPaste(): def main(self, skinMeshes, mode='copy', saveName='default', method='index', weightFile='auto', threshold=0.2, engine='maya', t...
21,306
8,141
#Copyright 2010 Brian E. Chapman # #Licensed under the Apache License, Version 2.0 (the "License"); #you may not use this file except in compliance with the License. #You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #Unless required by applicable law or agreed to in writing, s...
1,350
368
""" Provides a class that handles the fits metadata required by PypeIt. .. include common links, assuming primary doc root is up one directory .. include:: ../include/links.rst """ import os import io import string from copy import deepcopy import datetime from IPython import embed import numpy as np import yaml fr...
78,742
20,864
import os.path import shutil import errno from aql.nodes import Builder, FileBuilder from .aql_tools import Tool __all__ = ( "ExecuteCommand", "InstallBuilder", "BuiltinTool", ) """ Unique Value - name + type value node node = ExecuteCommand('gcc --help -v') tools.cpp.cxx node ...
2,341
726
from django.core.urlresolvers import reverse from django.db import models from django.utils.encoding import python_2_unicode_compatible from cms.models.fields import PlaceholderField from cms.utils import get_language_from_request from cms.utils.urlutils import admin_reverse from hvad.models import TranslatableModel,...
3,303
1,095
# 084 # Ask the user to type in their postcode.Display the first two # letters in uppercase. # very simple print(input('Enter your postcode: ')[0:2].upper())
159
53