repo_name stringlengths 7 94 | repo_path stringlengths 4 237 | repo_head_hexsha stringlengths 40 40 | content stringlengths 10 680k | apis stringlengths 2 680k |
|---|---|---|---|---|
snowxmas/alipay-sdk-python-all | alipay/aop/api/domain/KbAdvertSettleBillResponse.py | 96870ced60facd96c5bce18d19371720cbda3317 | #!/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... | [] |
PLCoster/adventofcode2019 | day5.py | 7aad1503dcf80b127b21191850ad9c93f91a602a | # -*- 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(',')
... | [] |
scclab/textvisdrg-prototype | textvis/textprizm/models.py | e912e4441b0e42e0f6c477edd03227b93b8ace73 | 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... | [((101, 133), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(200)'}), '(max_length=200)\n', (117, 133), False, 'from django.db import models\n'), ((152, 170), 'django.db.models.TextField', 'models.TextField', ([], {}), '()\n', (168, 170), False, 'from django.db import models\n'), ((215, 247), '... |
jacob22/accounting | test/test_purchasing.py | e2fceea880e3f056703ba97b6cf52b73cd7af93b | # -*- 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... | [((895, 920), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (910, 920), False, 'import os\n'), ((3115, 3223), 'py.test.mark.usefixtures', 'py.test.mark.usefixtures', (['"""cluster"""', '"""clean_db"""', '"""bootstrapped"""', '"""mailssh"""', '"""ssh"""', '"""org"""', '"""emailaddress"""'], {... |
SENERGY-Platform/senergy-connector | iot/downstream/fog_processes.py | 7198f6b2ec08b3c09c53755f259a2711921fdcbe | """
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... | [] |
aliyaandabekova/DJANGO_PROJECT | django_project/user_profile/migrations/0003_order_payment_method.py | 7b94f80fa56acf936da014aa5d91da79457bf4eb | # 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... | [((346, 448), 'django.db.models.CharField', 'models.CharField', ([], {'choices': "[('cash', 'cash'), ('wallet', 'wallet')]", 'default': '"""cash"""', 'max_length': '(10)'}), "(choices=[('cash', 'cash'), ('wallet', 'wallet')], default=\n 'cash', max_length=10)\n", (362, 448), False, 'from django.db import migrations,... |
mpirnat/aoc2016 | day07/test.py | 1aec59aca01541d0d1c30f85d4668959c82fa35c | #!/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', ... | [((2506, 2521), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2519, 2521), False, 'import unittest\n'), ((1609, 1634), 'day07.count_tls_addresses', 'count_tls_addresses', (['data'], {}), '(data)\n', (1628, 1634), False, 'from day07 import supports_tls, count_tls_addresses\n'), ((2443, 2468), 'day07.count_ssl_add... |
HTRPOCODES/HTRPO-v2 | rlnets/PG.py | 7e085e8077e6caa38d192bbd33b41c49b36ad6a6 | 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,
... | [((1147, 1179), 'basenets.MLP.MLP.forward', 'MLP.forward', (['self', 'x', 'other_data'], {}), '(self, x, other_data)\n', (1158, 1179), False, 'from basenets.MLP import MLP\n'), ((2478, 2510), 'basenets.MLP.MLP.forward', 'MLP.forward', (['self', 'x', 'other_data'], {}), '(self, x, other_data)\n', (2489, 2510), False, 'f... |
m4rkl1u/tensorflow | tensorflow/python/kernel_tests/sparse_tensors_map_ops_test.py | 90a8825c7ae9719e8969d45040b4155b0e7de130 | # 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... | [((10045, 10056), 'tensorflow.python.platform.test.main', 'test.main', ([], {}), '()\n', (10054, 10056), False, 'from tensorflow.python.platform import test\n'), ((2231, 2283), 'tensorflow.python.framework.sparse_tensor.SparseTensorValue', 'sparse_tensor_lib.SparseTensorValue', (['ind', 'val', 'shape'], {}), '(ind, val... |
RULCSoft/cloudroast | cloudroast/objectstorage/smoke/object_smoke.py | 30f0e64672676c3f90b4a582fe90fac6621475b3 | """
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... | [((17636, 17689), 'cloudroast.objectstorage.fixtures.ObjectStorageFixture.required_features', 'ObjectStorageFixture.required_features', (['"""object-cors"""'], {}), "('object-cors')\n", (17674, 17689), False, 'from cloudroast.objectstorage.fixtures import ObjectStorageFixture\n'), ((19267, 19320), 'cloudroast.objectsto... |
remicalixte/integrations-core | ceph/tests/conftest.py | b115e18c52820fe1a92495f538fdc14ddf83cfe1 | # (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... | [((599, 630), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (613, 630), False, 'import pytest\n'), ((672, 724), 'os.path.join', 'os.path.join', (['HERE', '"""compose"""', '"""docker-compose.yaml"""'], {}), "(HERE, 'compose', 'docker-compose.yaml')\n", (684, 724), False, 'i... |
weex/federation | federation/hostmeta/fetchers.py | 01357aacb04b076442ce5f803a0fc65df5a74d09 | 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
... | [((429, 479), 'federation.utils.network.fetch_document', 'fetch_document', ([], {'host': 'host', 'path': '"""/api/v1/instance"""'}), "(host=host, path='/api/v1/instance')\n", (443, 479), False, 'from federation.utils.network import fetch_document\n'), ((609, 643), 'federation.hostmeta.parsers.parse_mastodon_document', ... |
iag0g0mes/t2_fis_driving_style | features/analysis_features.py | 7f62ac3e67e65e7bd1273a2f845eb05820e95b70 | 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... | [((178, 203), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (201, 203), False, 'import argparse\n'), ((1851, 1880), 'os.path.exists', 'os.path.exists', (['args.data_dir'], {}), '(args.data_dir)\n', (1865, 1880), False, 'import os\n'), ((2083, 2121), 'os.path.join', 'os.path.join', (['args.data... |
scottwedge/OpenStack-Stein | python-watcher-2.0.0/watcher/tests/notifications/test_service_notifications.py | 7077d1f602031dace92916f14e36b124f474de15 | # -*- 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... | [((872, 923), 'freezegun.freeze_time', 'freezegun.freeze_time', (['"""2016-10-18T09:52:05.219414"""'], {}), "('2016-10-18T09:52:05.219414')\n", (893, 923), False, 'import freezegun\n'), ((1078, 1116), 'mock.patch.object', 'mock.patch.object', (['rpc', '"""get_notifier"""'], {}), "(rpc, 'get_notifier')\n", (1095, 1116),... |
rainzhop/cumulus-tank | leetcode/medium/best-time-to-buy-and-sell-stock-ii.py | 09ebc7858ea53630e30606945adfea856a80faa3 | # 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... | [] |
yashikajotwani12/django-loci | django_loci/tests/base/test_admin.py | 2c0bcb33f4a56d559f798e37fd17b2143b912ce4 | 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... | [((2215, 2239), 'os.remove', 'os.remove', (['fl.image.path'], {}), '(fl.image.path)\n', (2224, 2239), False, 'import os\n'), ((2668, 2692), 'os.remove', 'os.remove', (['fl.image.path'], {}), '(fl.image.path)\n', (2677, 2692), False, 'import os\n'), ((3200, 3228), 'json.loads', 'json.loads', (['response.content'], {}), ... |
vatsalag99/Deformable-Channel-Attention | dca_models/deform_offsets_module.py | d904135fd7be45331a16d9cb84e44f8e1ff5c07e | 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.... | [((773, 804), 'torch.bmm', 'torch.bmm', (['proj_query', 'proj_key'], {}), '(proj_query, proj_key)\n', (782, 804), False, 'import torch\n'), ((1006, 1051), 'torch.topk', 'torch.topk', (['cov_matrix', 'self.n_offsets'], {'dim': '(1)'}), '(cov_matrix, self.n_offsets, dim=1)\n', (1016, 1051), False, 'import torch\n'), ((11... |
egor43/PyImageComparsion | tests/__init__.py | 5270f5646c40391cc5ac225305d7be9b0b7de140 | from . import test_helpers
from . import test_image_opener
from . import test_image_metrick
from . import test_compare_tools
from . import test_compare_api | [] |
donnellan0007/blog | core/urls.py | 02c8850688422e3b685ffac10c32bf3e7a7c2e7a | 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,... | [((198, 233), 'django.urls.path', 'path', (['""""""', 'views.index'], {'name': '"""index"""'}), "('', views.index, name='index')\n", (202, 233), False, 'from django.urls import path\n'), ((237, 278), 'django.urls.path', 'path', (['"""email/"""', 'views.email'], {'name': '"""email"""'}), "('email/', views.email, name='e... |
pgolding/pandas-grid | griddy/__init__.py | 0f80db1511097656496dee503d7bb281b97b8bdc | from .grid import render_table | [] |
iamvishnuks/Xmigrate | utils/dbconn.py | f8405c72a2ee4203b0fc5ddb55c0a1d9f8d8a7c7 | 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... | [((506, 519), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (517, 519), False, 'from dotenv import load_dotenv\n'), ((531, 548), 'os.getenv', 'getenv', (['"""CASS_DB"""'], {}), "('CASS_DB')\n", (537, 548), False, 'from os import getenv\n'), ((565, 588), 'os.getenv', 'getenv', (['"""CASS_PASSWORD"""'], {}), "('... |
godormad/PySyft | src/syft/lib/__init__.py | fcb3374b6318dcccf377175fb8db6f70e9e1d1e3 | # 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... | [((2005, 2033), 'importlib.import_module', 'importlib.import_module', (['lib'], {}), '(lib)\n', (2028, 2033), False, 'import importlib\n'), ((2055, 2097), 'importlib.import_module', 'importlib.import_module', (['f"""syft.lib.{lib}"""'], {}), "(f'syft.lib.{lib}')\n", (2078, 2097), False, 'import importlib\n'), ((1442, 1... |
GavinHaLab/Griffin | scripts/griffin_GC_counts.py | 83942189c0e3e62ac533d6b6a5ffd7d2dfd2d4b3 | #!/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... | [((762, 787), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (785, 787), False, 'import argparse\n'), ((2901, 2949), 'pandas.read_csv', 'pd.read_csv', (['mapable_path'], {'sep': '"""\t"""', 'header': 'None'}), "(mapable_path, sep='\\t', header=None)\n", (2912, 2949), True, 'import pandas as pd\... |
canovasjm/InterviewProject_JuanCanovas | task2/04-task2-upload-dim-tables.py | 6ff385c66664328cea0678454560e89e44851e24 | #!/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... | [((269, 345), 'sqlalchemy.create_engine', 'create_engine', (['"""mssql+pymssql://sa:<YourStrong@Passw0rd>@localhost:1433/rga"""'], {}), "('mssql+pymssql://sa:<YourStrong@Passw0rd>@localhost:1433/rga')\n", (282, 345), False, 'from sqlalchemy import create_engine\n'), ((489, 564), 'pandas.read_excel', 'pd.read_excel', ([... |
vikasbaghel1001/Kanna-Chan | cogs/server.py | 6f74978cb73b66cdb0952351a7e84a9e4ef4ebeb | 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... | [((449, 467), 'discord.ext.commands.command', 'commands.command', ([], {}), '()\n', (465, 467), False, 'from discord.ext import commands\n'), ((473, 492), 'discord.ext.commands.is_owner', 'commands.is_owner', ([], {}), '()\n', (490, 492), False, 'from discord.ext import commands\n'), ((2661, 2679), 'discord.ext.command... |
timmartin/skulpt | test/run/t344.py | 2e3a3fbbaccc12baa29094a717ceec491a8a6750 | for ch in "Hello world!":
d = ord(ch)
h = hex(d)
o = oct(d)
b = bin(d)
print ch, d, h, o, b
| [] |
RandomGamer342/TTM4115-plantsensor | paho/mqtt/subscribe.py | e63c34160d284bb6fd26563eeba949d54026348b | # 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
# ... | [((4861, 4966), 'paho.mqtt.client.Client', 'paho.Client', ([], {'client_id': 'client_id', 'userdata': 'callback_userdata', 'protocol': 'protocol', 'transport': 'transport'}), '(client_id=client_id, userdata=callback_userdata, protocol=\n protocol, transport=transport)\n', (4872, 4966), True, 'import paho.mqtt.client... |
cs-cordero/advent-of-code | py/2017/day24/aoc_day_24.py | 614b8f78b43c54ef180a7dc411a0d1366a62944f | 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... | [((1114, 1130), 'collections.defaultdict', 'defaultdict', (['set'], {}), '(set)\n', (1125, 1130), False, 'from collections import defaultdict\n')] |
Gr1m3y/scratchnet | scratchnet/scratchnet.py | 5fce471b6e12dc05b3a92fd8581445f7d598d1c3 | import numpy as np
import network
def main():
x = np.array([2, 3])
nw = network.NeuralNetwork()
print(nw.feedforward(x))
if __name__ == "__main__":
main()
| [((56, 72), 'numpy.array', 'np.array', (['[2, 3]'], {}), '([2, 3])\n', (64, 72), True, 'import numpy as np\n'), ((82, 105), 'network.NeuralNetwork', 'network.NeuralNetwork', ([], {}), '()\n', (103, 105), False, 'import network\n')] |
rmhsawyer/EC601-Final-Project-Mapping_User_Face_To_Emoji | live-plotting.py | 05a61dca25ef6dc6827e3389a753eb65a09c1813 | #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'... | [((143, 171), 'matplotlib.style.use', 'style.use', (['"""fivethirtyeight"""'], {}), "('fivethirtyeight')\n", (152, 171), False, 'from matplotlib import style\n'), ((179, 191), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (189, 191), True, 'import matplotlib.pyplot as plt\n'), ((984, 1036), 'matplotlib.an... |
kirk86/ARS | code/run_policy.py | a4ac03e06bce5f183f7b18ea74b81c6c45c4426b | """
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():... | [((354, 379), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (377, 379), False, 'import argparse\n'), ((757, 789), 'numpy.load', 'np.load', (['args.expert_policy_file'], {}), '(args.expert_policy_file)\n', (764, 789), True, 'import numpy as np\n'), ((983, 1005), 'gym.make', 'gym.make', (['args.... |
TreshUp/poliastro | src/poliastro/plotting/tisserand.py | 602eb3c39d315be6dc1edaa12d72ab0e361334f6 | """ 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):
... | [((2205, 2259), 'numpy.linspace', 'np.linspace', (['vinf_span[0]', 'vinf_span[-1]', 'num_contours'], {}), '(vinf_span[0], vinf_span[-1], num_contours)\n', (2216, 2259), True, 'import numpy as np\n'), ((2282, 2325), 'numpy.linspace', 'np.linspace', (['alpha_lim[0]', 'alpha_lim[-1]', 'N'], {}), '(alpha_lim[0], alpha_lim[... |
jlin/inventory | libs/Rack.py | c098c98e570c3bf9fadfd811eb75e1213f6ea428 | 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
... | [((265, 281), 'django.test.client.RequestFactory', 'RequestFactory', ([], {}), '()\n', (279, 281), False, 'from django.test.client import RequestFactory\n'), ((994, 1011), 'api_v2.keyvalue_handler.KeyValueHandler', 'KeyValueHandler', ([], {}), '()\n', (1009, 1011), False, 'from api_v2.keyvalue_handler import KeyValueHa... |
returntocorp/inputset-generator | r2c_isg/functions/__init__.py | c33952cc5683e9e70b24f76936c42ec8e354d121 | from .trim import trim
from .sample import sample
from .sort import sort
function_map = {
'trim': trim,
'sample': sample,
'sort': sort
}
| [] |
csalyk/nirspec | __init__.py | 58661371871d29103afe42bfccc0bff9ff773914 | from .nirspec import divspec
from .nirspec import gluespec
| [] |
xcollantes/poetry-generator | poem.py | 456c9702f0105b49b8c3edbb55043a10efbf359b | 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... | [((9349, 9372), 're.sub', 're.sub', (['"""<.*?>"""', '""" """', 'p'], {}), "('<.*?>', ' ', p)\n", (9355, 9372), False, 'import re\n'), ((4448, 4488), 'uuid.uuid5', 'uuid.uuid5', (['uuid.NAMESPACE_DNS', 'seed_str'], {}), '(uuid.NAMESPACE_DNS, seed_str)\n', (4458, 4488), False, 'import uuid\n'), ((5150, 5172), 'random.ra... |
infonova/openstacksdk | openstack/tests/unit/block_storage/v2/test_proxy.py | 3cf6730a71d8fb448f24af8a5b4e82f2af749cea | # 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... | [((967, 993), 'openstack.block_storage.v2._proxy.Proxy', '_proxy.Proxy', (['self.session'], {}), '(self.session)\n', (979, 993), False, 'from openstack.block_storage.v2 import _proxy\n')] |
starofrainnight/ncstyler | src/ncstyler/console.py | d13a6fa330b955db1cb9aa7a6ff1751ec41e82eb | #!/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... | [((794, 842), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'description'}), '(description=description)\n', (817, 842), False, 'import argparse\n'), ((1754, 1814), 're.match', 're.match', (['"""[^\\\\w]*(\\\\w+)(?:\\\\(([^\\\\)]*)\\\\)|\\\\s*).*"""', 'adefine'], {}), "('[^\\\\w]*(\\\\w+)(?:... |
laozijiaojiangnan/TheOne | theone/wsgi/server.py | 73c1e7cee545c2eb2b2118f2dbf2d4d0c56e3824 | 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... | [] |
dzhulgakov/translate | pytorch_translate/attention/multihead_attention.py | 018d3eed8d93ff32e86c912e68045c7a3f4ed0b7 | #!/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... | [((202, 233), 'pytorch_translate.attention.register_attention', 'register_attention', (['"""multihead"""'], {}), "('multihead')\n", (220, 233), False, 'from pytorch_translate.attention import BaseAttention, attention_utils, register_attention\n'), ((1917, 1967), 'fairseq.modules.multihead_attention.MultiheadAttention',... |
RobertD502/home-assistant-lavviebot | custom_components/purrsong/__init__.py | 5c69f474786f043773cba42b7806fb77d4f89672 | """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... | [((449, 476), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (466, 476), False, 'import logging\n')] |
matbocz/kurs-python-udemy | MathPainting_OOP/shapes.py | bbc53d0b2073b400aaad5ff908b3e1c09b815121 | 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... | [] |
sddyates/mars | problems/Kelvin_Helmholtz/problem.py | a56735bd344b7337151fb419b1c832b0c702ea69 |
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... | [((1942, 1980), 'numpy.meshgrid', 'np.meshgrid', (['g.x1', 'g.x2'], {'indexing': '"""ij"""'}), "(g.x1, g.x2, indexing='ij')\n", (1953, 1980), True, 'import numpy as np\n'), ((2053, 2097), 'numpy.meshgrid', 'np.meshgrid', (['g.x1', 'g.x2', 'g.x3'], {'indexing': '"""ij"""'}), "(g.x1, g.x2, g.x3, indexing='ij')\n", (2064,... |
korkeatw/pythainlp | pythainlp/util/thai.py | 6fc7c3434d5e58c8e8e2bf13470445cbab0866bd | # -*- 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
"... | [] |
zharmedia386/Data-Science-Stuff | Numpy/tempCodeRunnerFile.py | 40183c329e3b30c582c545c260ca7916f29e2f09 |
print(b)
print(c)
print(d)
print(e)
print(f)
print(g) | [] |
KilroyWasHere-cs-j/savitzky-golay | Python/Filter.py | 2ce110d54e9ad7bc1e4a0c29fa80ad8303ec530f | 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... | [((175, 196), 'numpy.linspace', 'np.linspace', (['(0)', '(5)', '(11)'], {}), '(0, 5, 11)\n', (186, 196), True, 'import numpy as np\n'), ((253, 281), 'numpy.random.randint', 'np.random.randint', (['(10)', '(20)', '(2)'], {}), '(10, 20, 2)\n', (270, 281), True, 'import numpy as np\n'), ((293, 325), 'numpy.concatenate', '... |
dietrichc/streamline-ppc-reports | examples/adwords/v201406/advanced_operations/add_ad_customizer.py | 256f79246aba3c2cf8f792d87a066391a2f471e0 | #!/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... | [] |
azachar/pyminhash | tests/test_minhash.py | 8a595fb25fe7172ea31d604fe8a40b8c11f1b8af | 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 == ... | [((124, 135), 'pyminhash.datasets.load_data', 'load_data', ([], {}), '()\n', (133, 135), False, 'from pyminhash.datasets import load_data\n'), ((154, 165), 'pyminhash.MinHash', 'MinHash', (['(10)'], {}), '(10)\n', (161, 165), False, 'from pyminhash import MinHash\n'), ((406, 437), 'pyminhash.MinHash', 'MinHash', ([], {... |
danylo-dudok/youtube-rss | settings.py | c4478605274cdeac33f909d7fcb7d265898e80bc | 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... | [((401, 415), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (413, 415), False, 'from datetime import datetime, timedelta\n'), ((418, 451), 'datetime.timedelta', 'timedelta', ([], {'days': 'TWO_WEEKS_IN_DAYS'}), '(days=TWO_WEEKS_IN_DAYS)\n', (427, 451), False, 'from datetime import datetime, timedelta\n')] |
DX-MON/OpenPICle | openpicle/caravel.py | c036333f807b1b4959af22bde8c4cac553ef162f | # 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()
... | [((292, 300), 'amaranth.Module', 'Module', ([], {}), '()\n', (298, 300), False, 'from amaranth import Elaboratable, Module, Signal, ResetInserter, EnableInserter\n'), ((311, 319), 'amaranth.Signal', 'Signal', ([], {}), '()\n', (317, 319), False, 'from amaranth import Elaboratable, Module, Signal, ResetInserter, EnableI... |
est73/raid-shack | cogs/stats.py | 727b79a50a0ff5a5fc1cdfe03d51ba6703343b2e | 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... | [((136, 154), 'discord.ext.commands.command', 'commands.command', ([], {}), '()\n', (152, 154), False, 'from discord.ext import commands\n'), ((160, 206), 'discord.ext.commands.has_permissions', 'commands.has_permissions', ([], {'manage_channels': '(True)'}), '(manage_channels=True)\n', (184, 206), False, 'from discord... |
WillChilds-Klein/mistress-mapreduce | tests/bucket/test_bucket.py | c991a502545bd0d3ec4f914cdc63faf6a40e77ae | 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... | [((105, 122), 'mrs.bucket.WriteBucket', 'WriteBucket', (['(0)', '(0)'], {}), '(0, 0)\n', (116, 122), False, 'from mrs.bucket import WriteBucket\n'), ((421, 438), 'mrs.bucket.WriteBucket', 'WriteBucket', (['(0)', '(0)'], {}), '(0, 0)\n', (432, 438), False, 'from mrs.bucket import WriteBucket\n'), ((735, 790), 'mrs.bucke... |
HARPLab/inquire | inquire/agents/dempref.py | fa74eb10e5391a0f226753668a31527c68fc6962 | """
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... | [((4910, 4971), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': "['run #', 'pref_iter', 'type', 'value']"}), "(columns=['run #', 'pref_iter', 'type', 'value'])\n", (4922, 4971), True, 'import pandas as pd\n'), ((5763, 5794), 'numpy.mean', 'np.mean', (['self.w_samples'], {'axis': '(0)'}), '(self.w_samples, axis=0)\... |
mrucker/banditbenchmark | coba/learners/__init__.py | 0365291b3a0cf1d862d294e0386d0ccad3f360f1 | """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... | [] |
Lenus254/personal_blog | virtual/lib/python3.8/site-packages/dns/zonefile.py | aac38e4b5372c86efa8e24db2e051fef8e5feef8 | # 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 ... | [((7896, 7948), 're.compile', 're.compile', (['"""^.*\\\\$({(\\\\+|-?)(\\\\d+),(\\\\d+),(.)}).*$"""'], {}), "('^.*\\\\$({(\\\\+|-?)(\\\\d+),(\\\\d+),(.)}).*$')\n", (7906, 7948), False, 'import re\n'), ((7969, 8010), 're.compile', 're.compile', (['"""^.*\\\\$({(\\\\+|-?)(\\\\d+)}).*$"""'], {}), "('^.*\\\\$({(\\\\+|-?)(\... |
fossabot/swift-1 | swift/common/daemon.py | 63fc013b8b96484cede0e9901ad54676b8c93298 | # 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... | [((10760, 10795), 'swift.common.utils.modify_priority', 'utils.modify_priority', (['conf', 'logger'], {}), '(conf, logger)\n', (10781, 10795), False, 'from swift.common import utils\n'), ((11474, 11486), 'time.tzset', 'time.tzset', ([], {}), '()\n', (11484, 11486), False, 'import time\n'), ((1586, 1628), 'swift.common.... |
Bhaskers-Blu-Org1/multicloud-incident-response-navigator | backend/resource_files_sample.py | e6ba6322fdcc533b6ed14abb4681470a6bb6bd85 | 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... | [((35, 65), 'resource_files.ResourceFiles', 'resource_files.ResourceFiles', ([], {}), '()\n', (63, 65), False, 'import resource_files\n')] |
aroraenterprise/projecteos | backend/api/v1/auth_module/auth_api.py | e1fb0438af8cb59b77792523c6616c480b23a6f8 | """
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... | [((381, 420), 'api.v1.fundamentals.helper.parse_args_for_model', 'helper.parse_args_for_model', (['_UserModel'], {}), '(_UserModel)\n', (408, 420), False, 'from api.v1.fundamentals import helper\n'), ((1119, 1197), 'api.v1.SageController', 'SageController', (['sage_auth_signup_function', 'SageMethod.POST'], {'authentic... |
AngsarM/QuanGuru | tests/QuantumToolboxIntegration/test_singleQubitOpenDynamics.py | 5db6105f843bbc78c2d5b1547e32d494fbe10b8d | 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... | [((587, 598), 'random.random', 'rn.random', ([], {}), '()\n', (596, 598), True, 'import random as rn\n'), ((634, 690), 'numpy.exp', 'np.exp', (['(-(1e-05 * (decayRateSM + 1) * 2 + 1.0j) * 50 * t)'], {}), '(-(1e-05 * (decayRateSM + 1) * 2 + 1.0j) * 50 * t)\n', (640, 690), True, 'import numpy as np\n')] |
Mohamed-ShehabEldin/QuGraphy | QuGraphy/state.py | c43fe7128f91e7bd383393f5ff16ff613077e8d7 | #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... | [] |
GeoscienceAustralia/uncoverml | uncoverml/metadata_profiler.py | 672914377afa4ad1c069fcd4845bc45f80132e36 | #! /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... | [((1901, 1918), 'getpass.getuser', 'getpass.getuser', ([], {}), '()\n', (1916, 1918), False, 'import getpass\n'), ((1938, 1958), 'socket.gethostname', 'socket.gethostname', ([], {}), '()\n', (1956, 1958), False, 'import socket\n'), ((2172, 2282), 'ppretty.ppretty', 'ppretty', (['self.model'], {'indent': '""" """', 'sh... |
thisisishara/test_pypi_cli | testjpkg/jsonify/hij.py | 15b22ed8943a18a6d9de9ee4ba6a84249a633e2e | print("hiiiiiiiiiiiiiiiix")
def sayhi():
print("2nd pkg said hi")
| [] |
raspbian-packages/pandas | asv_bench/benchmarks/algorithms.py | fb33806b5286deb327b2e0fa96aedf25a6ed563f | 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... | [((524, 542), 'numpy.arange', 'np.arange', (['(1000000)'], {}), '(1000000)\n', (533, 542), True, 'import numpy as np\n'), ((565, 583), 'numpy.arange', 'np.arange', (['(1000000)'], {}), '(1000000)\n', (574, 583), True, 'import numpy as np\n'), ((606, 628), 'numpy.arange', 'np.arange', (['(-1000000)', '(0)'], {}), '(-100... |
lh-astro/RM-Tools | RMtools_1D/do_RMsynth_1D.py | ac64cc41b2f696f21ee7dd001303cbad1ff71114 | #!/usr/bin/env python
#=============================================================================#
# #
# NAME: do_RMsynth_1D.py #
# ... | [((6490, 6524), 'os.path.splitext', 'os.path.splitext', (['args.dataFile[0]'], {}), '(args.dataFile[0])\n', (6506, 6524), False, 'import os\n'), ((7832, 7996), 'RMutils.util_misc.create_frac_spectra', 'create_frac_spectra', ([], {'freqArr': 'freqArr_GHz', 'IArr': 'IArr', 'QArr': 'QArr', 'UArr': 'UArr', 'dIArr': 'dIArr'... |
awesome-archive/cogdl | cogdl/modules/conv/__init__.py | 0a354eaaaf851e7218197508e7e85a81d3fb5753 | 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'
]
| [] |
gpescia/MyNetKet | netket/utils/jax.py | 958510966a5870d9d491de0628903cf1fc210921 | # 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 ... | [] |
Kungreye/gee_tools | geetools/batch/featurecollection.py | d0712ac78410250c41503ca08075f536d58d2ef3 | # 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... | [((637, 663), 'ee.Projection', 'ee.Projection', (['"""EPSG:4326"""'], {}), "('EPSG:4326')\n", (650, 663), False, 'import ee\n'), ((701, 727), 'shapefile.Reader', 'shapefile.Reader', (['filename'], {}), '(filename)\n', (717, 727), False, 'import shapefile\n'), ((2313, 2343), 'ee.FeatureCollection', 'ee.FeatureCollection... |
extwiii/Rock-paper-scissors-lizard-Spock | index.py | 7a8eda9f168636a9878c91620e625997ba0994a8 | # 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 ... | [] |
greenelab/phenoplier | libs/clustering/ensembles/utils.py | 95f04b17f0b5227560fcf32ac0a85b2c5aa9001f | """
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... | [((4500, 4596), 'sklearn.metrics.pairwise_distances', 'pairwise_distances', (['ensemble.T'], {'metric': '_compare', 'n_jobs': 'n_jobs', 'force_all_finite': '"""allow-nan"""'}), "(ensemble.T, metric=_compare, n_jobs=n_jobs,\n force_all_finite='allow-nan')\n", (4518, 4596), False, 'from sklearn.metrics import pairwise... |
toshi-click/chart_app | backend/chart/application/service/employees.py | 10577d7835554a93688ae0c58ecb25fbe2925bec | 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 ... | [((542, 562), 'django.db.transaction.atomic', 'transaction.atomic', ([], {}), '()\n', (560, 562), False, 'from django.db import transaction, connection\n'), ((1209, 1229), 'django.db.transaction.atomic', 'transaction.atomic', ([], {}), '()\n', (1227, 1229), False, 'from django.db import transaction, connection\n'), ((1... |
pwyf/data-quality-tester | DataQualityTester/views/pages.py | d7674849c64d4d41ff4e4b6b12631994c7ce0a92 | from flask import render_template
def home():
return render_template('upload.html')
def about():
return render_template('about.html')
| [((59, 89), 'flask.render_template', 'render_template', (['"""upload.html"""'], {}), "('upload.html')\n", (74, 89), False, 'from flask import render_template\n'), ((116, 145), 'flask.render_template', 'render_template', (['"""about.html"""'], {}), "('about.html')\n", (131, 145), False, 'from flask import render_templat... |
roselight/Image-Recognition-with-OpenCv | hastakayit_gui.py | 4d0607f37bc80ee0b00790cdcbb0a22c76852ac4 | # -*- 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... | [((5584, 5616), 'PyQt5.QtWidgets.QApplication', 'QtWidgets.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (5606, 5616), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((5634, 5657), 'PyQt5.QtWidgets.QMainWindow', 'QtWidgets.QMainWindow', ([], {}), '()\n', (5655, 5657), False, 'from PyQt5 import QtCore, QtG... |
loonwerks/AGREE | .travis/manage_daily_builds.py | 58640ab89aaa3c72ccca0b8c80cf96d1815981da | #!/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... | [((1632, 1731), 're.compile', 're.compile', (['"""com.rockwellcollins.atc.agree.repository-\\\\d+\\\\.\\\\d+\\\\.\\\\d+(-(\\\\d{12}))?-.*"""'], {}), "(\n 'com.rockwellcollins.atc.agree.repository-\\\\d+\\\\.\\\\d+\\\\.\\\\d+(-(\\\\d{12}))?-.*'\n )\n", (1642, 1731), False, 'import re\n'), ((1834, 1870), 'github3.G... |
KaihuiLiang/ParlAI | tests/crowdsourcing/tasks/turn_annotations_static/test_turn_annotations_static_analysis.py | fb5c92741243756516fa50073d34e94ba0b6981e | #!/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... | [((5727, 5742), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5740, 5742), False, 'import unittest\n'), ((865, 888), 'parlai.utils.testing.tempdir', 'testing_utils.tempdir', ([], {}), '()\n', (886, 888), True, 'import parlai.utils.testing as testing_utils\n'), ((1362, 1418), 'os.path.join', 'os.path.join', (['an... |
bartongroup/slivka-bio | scripts/selectors.py | 049aee943503963ce5c9b14267fe001edd8e0125 | def example_selector(*args, **kwargs): return "default"
| [] |
mith1979/ansible_automation | applied_python/applied_python/lib/python2.7/site-packages/ansible/modules/extras/messaging/rabbitmq_plugin.py | 013dfa67c6d91720b787fadb21de574b6e023a26 | #!/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... | [] |
HoonMinJeongUm/Hunmin-vitrage | vitrage/datasources/static/driver.py | 37d43d6b78e8b76fa6a2e83e5c739e9e4917a7b6 | # 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... | [((997, 1020), 'oslo_log.log.getLogger', 'log.getLogger', (['__name__'], {}), '(__name__)\n', (1010, 1020), False, 'from oslo_log import log\n'), ((2380, 2443), 'vitrage.utils.file.list_files', 'file_utils.list_files', (['self.cfg.static.directory', '""".yaml"""', '(True)'], {}), "(self.cfg.static.directory, '.yaml', T... |
marshuang80/napari | napari/layers/shapes/mesh.py | 10f1d0f39fe9ccd42456c95458e2f23b59450f02 | 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 ... | [((2008, 2024), 'numpy.empty', 'np.empty', (['(0, 2)'], {}), '((0, 2))\n', (2016, 2024), True, 'import numpy as np\n'), ((2057, 2073), 'numpy.empty', 'np.empty', (['(0, 2)'], {}), '((0, 2))\n', (2065, 2073), True, 'import numpy as np\n'), ((2106, 2122), 'numpy.empty', 'np.empty', (['(0, 2)'], {}), '((0, 2))\n', (2114, ... |
cdacos/astrophysics_with_a_pc | python/helpers.py | b0017856005a4771fbd89c8137fb320b72b1b633 | 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))
| [] |
MarioCarrilloA/stx-packaging | configs/docker-ubuntu-img/para.py | 56cf32c4d65ba20f9317102d922ce946a800527d | #!/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... | [((1713, 1724), 'os.getuid', 'os.getuid', ([], {}), '()\n', (1722, 1724), False, 'import os\n'), ((1958, 1969), 'os.getuid', 'os.getuid', ([], {}), '()\n', (1967, 1969), False, 'import os\n')] |
lukejamison/jet-dasboard | build/lib/jet_django/views/model.py | 5dce66b6ea2f107d7120e5e0256346d2d3bc8ed9 | 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... | [((648, 674), 'rest_framework.serializers.IntegerField', 'serializers.IntegerField', ([], {}), '()\n', (672, 674), False, 'from rest_framework import status, viewsets, serializers\n'), ((931, 954), 'rest_framework.serializers.CharField', 'serializers.CharField', ([], {}), '()\n', (952, 954), False, 'from rest_framework... |
LeGamermc/ursina_tutorials | python_minecraft_tut_2021/weatherCraft.py | f0ad518be3a02cdb52f27c87f2f70817b4d0e8b0 | """
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):
... | [((325, 365), 'nMap.nMap', 'nMap', (['this.darkling', '(0)', '(100)', '(0)', 'this.red'], {}), '(this.darkling, 0, 100, 0, this.red)\n', (329, 365), False, 'from nMap import nMap\n'), ((374, 416), 'nMap.nMap', 'nMap', (['this.darkling', '(0)', '(100)', '(0)', 'this.green'], {}), '(this.darkling, 0, 100, 0, this.green)\... |
davefancella/davenetgame | davenetgame/dispatch/dispatcher.py | f16c36539a3898ab4a021e63feef7fe497e5bc69 | #!/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... | [((6754, 6793), 'threading.Thread.__init__', 'threading.Thread.__init__', (['self'], {}), '(self, **args)\n', (6779, 6793), False, 'import threading, time\n'), ((6816, 6833), 'threading.RLock', 'threading.RLock', ([], {}), '()\n', (6831, 6833), False, 'import threading, time\n'), ((7752, 7768), 'time.sleep', 'time.slee... |
zenofewords/thebrushstash | account/migrations/0003_customuser_phone_number.py | 7d53bd5f22a2daa1011bb502bce56e735504dc84 | # 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='... | [((353, 397), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_length': '(500)'}), '(blank=True, max_length=500)\n', (369, 397), False, 'from django.db import migrations, models\n')] |
gabrieldcpadilha/ListaDeExercicios-PythonBrasil | 03_Estrutura_de_Repeticao/13_potenciacao.py | a92d477468bde5eac8987a26ea79af2ffeb6ad81 | 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}'... | [] |
noahjacob/Accounting | accounting/accounting/doctype/journal_entry/journal_entry.py | 6be90c4f82867156532ca71b1faa9d017e3269af | # -*- 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_... | [((942, 994), 'accounting.accounting.general_ledger.make_reverse_gl_entry', 'make_reverse_gl_entry', (['self', 'self.doctype', 'self.name'], {}), '(self, self.doctype, self.name)\n', (963, 994), False, 'from accounting.accounting.general_ledger import make_gl_entry, make_reverse_gl_entry\n'), ((1270, 1291), 'frappe.uti... |
mmeooo/test_django | polls/models.py | 0364f43549d4082df7100d11c67dd42dc2a82b32 | 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개 타입으로 클래스 만들면 ... | [((128, 160), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (144, 160), False, 'from django.db import models\n'), ((198, 230), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (214, 230), False, 'from django.d... |
jack139/HF | ipcam/test_snap.py | 4810f4ee2faf9ab51c867e105addc139da2adfd1 | #!/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... | [] |
M4rukku/impact_of_non_iid_data_in_federated_learning | sources/datasets/client_dataset_definitions/client_dataset.py | c818db03699c82e42217d56f8ddd4cc2081c8bb1 | 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... | [((434, 455), 'functools.wraps', 'functools.wraps', (['func'], {}), '(func)\n', (449, 455), False, 'import functools\n'), ((5595, 5607), 'gc.collect', 'gc.collect', ([], {}), '()\n', (5605, 5607), False, 'import gc\n'), ((560, 845), 'sources.utils.exception_definitions.OutsideOfContextError', 'OutsideOfContextError', (... |
mfrigerio17/robot-model-tools | src/rmt/kinematics.py | 97e25d5c4d1386c503d37a70b57400022c5b7ca0 | 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.... | [((192, 219), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (209, 219), False, 'import logging\n'), ((1632, 1675), 'kgprim.ct.frommotions.toCoordinateTransform', 'frommotions.toCoordinateTransform', (['poseSpec'], {}), '(poseSpec)\n', (1665, 1675), True, 'import kgprim.ct.frommotions as ... |
atr0s/awx | awx/main/management/commands/run_dispatcher.py | 388ef077c384f4c5296d4870d3b0cf0e6718db80 | # 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... | [] |
Nuri-benbarka/PCDet | pcdet/utils/box_coder_utils.py | 8da66ead3bb1120db2fa919187948c8c134e85ae | 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... | [((498, 534), 'numpy.split', 'np.split', (['anchors', 'box_ndim'], {'axis': '(-1)'}), '(anchors, box_ndim, axis=-1)\n', (506, 534), True, 'import numpy as np\n'), ((578, 612), 'numpy.split', 'np.split', (['boxes', 'box_ndim'], {'axis': '(-1)'}), '(boxes, box_ndim, axis=-1)\n', (586, 612), True, 'import numpy as np\n'),... |
jainajinkya/deep_bingham | utils/utils.py | 2ea85b3ea2af579eab36567091b88a1bbf4a627b | """ 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... | [((1002, 1024), 'numpy.array', 'np.array', (['[w, x, y, z]'], {}), '([w, x, y, z])\n', (1010, 1024), True, 'import numpy as np\n'), ((2828, 2848), 'os.path.exists', 'os.path.exists', (['path'], {}), '(path)\n', (2842, 2848), False, 'import os\n'), ((3568, 3593), 'numpy.array', 'np.array', (['[0.0, 0.0, 0.0]'], {}), '([... |
obatsis/Distributed-NTUA | cli_ui.py | 0bf39163b64aaefb2576be01337e0ec6e026ce6d | 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... | [((243, 428), 'PyInquirer.style_from_dict', 'style_from_dict', (["{Token.QuestionMark: '#E91E63 bold', Token.Selected: '#673AB7 bold', Token.\n Instruction: '#0bf416', Token.Answer: '#2196f3 bold', Token.Question:\n '#0bf416 bold'}"], {}), "({Token.QuestionMark: '#E91E63 bold', Token.Selected:\n '#673AB7 bold'... |
jdrese/SIWeightEditor | Contents/scripts/siweighteditor/weight.py | 0529c1a366b955f4373acd2e2f08f63b7909ff82 | # -*- 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... | [] |
Blulab-Utah/pyConTextPipeline | pyConTextNLP/__init__.py | d4060f89d54f4db56914832033f8ce589ee3c181 | #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... | [((1235, 1260), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (1250, 1260), False, 'import os\n')] |
rcooke-ast/PYPIT | pypeit/metadata.py | 0cb9c4cb422736b855065a35aefc2bdba6d51dd0 | """
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... | [((78727, 78740), 'numpy.all', 'np.all', (['match'], {}), '(match)\n', (78733, 78740), True, 'import numpy as np\n'), ((4634, 4663), 'pypeit.core.framematch.FrameTypeBitMask', 'framematch.FrameTypeBitMask', ([], {}), '()\n', (4661, 4663), False, 'from pypeit.core import framematch\n'), ((11930, 11956), 'pypeit.core.met... |
menify/sandbox | aql/aql/main/aql_builtin_tools.py | 32166c71044f0d5b414335b2b6559adc571f568c |
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 ... | [((1729, 1756), 'shutil.copy', 'shutil.copy', (['source', 'target'], {}), '(source, target)\n', (1740, 1756), False, 'import shutil\n')] |
stefanw/django-cms | cms/test_utils/project/placeholderapp/models.py | 048ec9e7a529549d51f4805fdfbcd50ea1e624b0 | 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,... | [((544, 587), 'django.db.models.CharField', 'models.CharField', (['u"""char_1"""'], {'max_length': '(255)'}), "(u'char_1', max_length=255)\n", (560, 587), False, 'from django.db import models\n'), ((601, 644), 'django.db.models.CharField', 'models.CharField', (['u"""char_2"""'], {'max_length': '(255)'}), "(u'char_2', m... |
DGrifferty/Python | 150-Challenges/Challenges 80 - 87/Challenge 84.py | d725301664db2cbcfd5c4f5974745b4d81c8e28a | # 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()) | [] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.