repo_name stringlengths 7 94 | repo_path stringlengths 4 237 | repo_head_hexsha stringlengths 40 40 | content stringlengths 10 680k | apis stringlengths 2 680k |
|---|---|---|---|---|
liudonghua123/bridgedb | lib/bridgedb/email/request.py | 94dd10673f9e6650e8a00e162f348e64f7a1ecab | # -*- coding: utf-8; test-case-name: bridgedb.test.test_email_request; -*-
#_____________________________________________________________________________
#
# This file is part of BridgeDB, a Tor bridge distribution system.
#
# :authors: Nick Mathewson <nickm@torproject.org>
# Isis Lovecruft <isis@torproject.o... | [((1722, 1750), 're.compile', 're.compile', (['TRANSPORT_REGEXP'], {}), '(TRANSPORT_REGEXP)\n', (1732, 1750), False, 'import re\n'), ((1907, 1935), 're.compile', 're.compile', (['UNBLOCKED_REGEXP'], {}), '(UNBLOCKED_REGEXP)\n', (1917, 1935), False, 'import re\n'), ((3628, 3685), 'logging.debug', 'logging.debug', (['"""... |
Unknoob/buck | test/com/facebook/buck/skylark/parser/testdata/rule_with_wrong_types/attr_value_type/subdir/foo.bzl | 2dfc734354b326f2f66896dde7746a11965d5a13 | """ Module docstring """
def _impl(_ctx):
""" Function docstring """
pass
some_rule = rule(
attrs = {
"attr1": attr.int(
default = 2,
mandatory = False,
),
"attr2": 5,
},
implementation = _impl,
)
| [] |
griimx/Summer-2016 | src/printReport.py | 08bf0a68a0e12ee81318409f68448adaf75983fe | from __future__ import print_function
from connection import *
from jinja2 import Environment, FileSystemLoader
import webbrowser
def print_report(id):
env = Environment(loader=FileSystemLoader('.'))
template = env.get_template("src/template.html")
cursor = db.cursor(MySQLdb.cursors.DictCursor)
sql = "SELECT e.*... | [((1360, 1397), 'webbrowser.open_new_tab', 'webbrowser.open_new_tab', (['"""print.html"""'], {}), "('print.html')\n", (1383, 1397), False, 'import webbrowser\n'), ((179, 200), 'jinja2.FileSystemLoader', 'FileSystemLoader', (['"""."""'], {}), "('.')\n", (195, 200), False, 'from jinja2 import Environment, FileSystemLoade... |
avalentino/pyre | packages/pyre/schemata/Container.py | 7e1f0287eb7eba1c6d1ef385e5160079283ac363 | # -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2021 all rights reserved
#
# superclass
from .Schema import Schema
# declaration
class Container(Schema):
"""
The base class for type declarators that are sequences of other types
"""
# constants
typename = 'container' # ... | [] |
nomad-coe/electronic-parsers | electronicparsers/exciting/parser.py | defb47be6ac22b2e48d4fb9204c85390a3c2f328 | #
# Copyright The NOMAD Authors.
#
# This file is part of NOMAD.
# See https://nomad-lab.eu for further info.
#
# 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/lic... | [((22188, 22215), 're.compile', 're.compile', (['"""([A-Z][a-z]?)"""'], {}), "('([A-Z][a-z]?)')\n", (22198, 22215), False, 'import re\n'), ((39102, 39121), 'numpy.array', 'np.array', (['positions'], {}), '(positions)\n', (39110, 39121), True, 'import numpy as np\n'), ((42197, 42213), 'nomad.parsing.file_parser.DataText... |
KZzizzle/osparc-simcore | services/storage/client-sdk/python/simcore_service_storage_sdk/api/users_api.py | 981bc8d193f3f5d507e3225f857e0308c339e163 | # coding: utf-8
"""
simcore-service-storage API
API definition for simcore-service-storage service # noqa: E501
OpenAPI spec version: 0.1.0
Contact: support@simcore.io
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 a... | [((2747, 2788), 'six.iteritems', 'six.iteritems', (["local_var_params['kwargs']"], {}), "(local_var_params['kwargs'])\n", (2760, 2788), False, 'import six\n'), ((7028, 7069), 'six.iteritems', 'six.iteritems', (["local_var_params['kwargs']"], {}), "(local_var_params['kwargs'])\n", (7041, 7069), False, 'import six\n'), (... |
mattiolato98/reservation-ninja | reservation_management/migrations/0021_delete_greenpass.py | 0e50b218dd9d90f134868bade2ec2934283c12b5 | # Generated by Django 3.2.7 on 2021-10-22 14:23
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('reservation_management', '0020_greenpass'),
]
operations = [
migrations.DeleteModel(
name='GreenPass',
),
]
| [((233, 273), 'django.db.migrations.DeleteModel', 'migrations.DeleteModel', ([], {'name': '"""GreenPass"""'}), "(name='GreenPass')\n", (255, 273), False, 'from django.db import migrations\n')] |
bionet/ted.python | demos/iaf_pop_demo.py | 1698a7f792db23123003ae4e2d39b4c18f25f347 | #!/usr/bin/env python
"""
Demos of encoding and decoding algorithms using populations of
IAF neurons.
"""
# Copyright (c) 2009-2015, Lev Givon
# All rights reserved.
# Distributed under the terms of the BSD license:
# http://www.opensource.org/licenses/bsd-license
import sys
import numpy as np
# Set matplotlib back... | [] |
bpmbank/PythonJS | regtests/calling/function_expression.py | 591a80afd8233fb715493591db2b68f1748558d9 | """func expr"""
F = function( x,y ):
return x+y
def main():
TestError( F(1,2) == 3 )
| [] |
A425/django-xadmin-1.8 | nadmin/plugins/sortable.py | 9ab06192311b22ec654778935ce3e3c5ffd39a00 | #coding:utf-8
from nadmin.sites import site
from nadmin.views import BaseAdminPlugin, ListAdminView
SORTBY_VAR = '_sort_by'
class SortablePlugin(BaseAdminPlugin):
sortable_fields = ['sort']
# Media
def get_media(self, media):
if self.sortable_fields and self.request.GET.get(SORTBY_VAR):
... | [((1214, 1265), 'nadmin.sites.site.register_plugin', 'site.register_plugin', (['SortablePlugin', 'ListAdminView'], {}), '(SortablePlugin, ListAdminView)\n', (1234, 1265), False, 'from nadmin.sites import site\n')] |
texastribune/donations | batch-tmp.py | 45a75e528564b5fd502319ed7d512ca91bda7f37 | import logging
from config import ACCOUNTING_MAIL_RECIPIENT, LOG_LEVEL, REDIS_URL, TIMEZONE
from datetime import datetime, timedelta
from pytz import timezone
import celery
import redis
from charges import amount_to_charge, charge, ChargeException
from npsp import Opportunity
from util import send_email
zone = timez... | [((315, 333), 'pytz.timezone', 'timezone', (['TIMEZONE'], {}), '(TIMEZONE)\n', (323, 333), False, 'from pytz import timezone\n'), ((348, 379), 'logging.getLevelName', 'logging.getLevelName', (['LOG_LEVEL'], {}), '(LOG_LEVEL)\n', (368, 379), False, 'import logging\n'), ((388, 407), 'logging.getLogger', 'logging.getLogge... |
coblee/rotki | rotkehlchen/tests/integration/test_blockchain.py | d675f5c2d0df5176337b7b10038524ee74923482 | import operator
import os
from unittest.mock import patch
import pytest
import requests
from rotkehlchen.chain.ethereum.manager import NodeName
from rotkehlchen.constants.assets import A_BTC
from rotkehlchen.tests.utils.blockchain import mock_etherscan_query
from rotkehlchen.typing import SupportedBlockchain
@pytes... | [((315, 420), 'pytest.mark.skipif', 'pytest.mark.skipif', (["(os.name == 'nt')"], {'reason': '"""Not testing running with geth in windows at the moment"""'}), "(os.name == 'nt', reason=\n 'Not testing running with geth in windows at the moment')\n", (333, 420), False, 'import pytest\n'), ((428, 486), 'pytest.mark.pa... |
LaptopBiologist/ReferenceAnalyzer | __init__.py | 109f1f58ee2b0173e7285156091ba2b11459ff85 | #-------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: I am
#
# Created: 02/11/2017
# Copyright: (c) I am 2017
# Licence: <your licence>
#-------------------------------------------------------------------------------
def main():
... | [] |
jimmybutton/moviedb | app/__init__.py | 61028ac4db7f58a671ab3a1c2afd3bfb53372773 | from flask import Flask
from config import Config
from sqlalchemy import MetaData
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_login import LoginManager
from flask_moment import Moment
from flask_misaka import Misaka
from flask_bootstrap import Bootstrap
import os
import logging
... | [((677, 715), 'sqlalchemy.MetaData', 'MetaData', ([], {'naming_convention': 'convention'}), '(naming_convention=convention)\n', (685, 715), False, 'from sqlalchemy import MetaData\n'), ((722, 751), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', ([], {'metadata': 'metadata'}), '(metadata=metadata)\n', (732, 751), False, '... |
AranKomat/Sequential-Alpha-Zero | optimize.py | 21f78dc95e70b68b5fd18eb33d1ea2d5b5a853d4 | import numpy as np
import random
from time import time, sleep
import h5py
import torch
import torch.nn as nn
import torch.optim as optimizer
import glob
import os
#from scipy.stats import rankdata
from lstm import Model, initialize
from Optim import ScheduledOptim
# import _pickle as cPickle
# np.set_printoptions(t... | [((370, 383), 'lstm.Model', 'Model', (['config'], {}), '(config)\n', (375, 383), False, 'from lstm import Model, initialize\n'), ((842, 877), 'glob.glob', 'glob.glob', (["(config.model_path + '/*')"], {}), "(config.model_path + '/*')\n", (851, 877), False, 'import glob\n'), ((1133, 1155), 'torch.load', 'torch.load', ([... |
Command-Master/MCCC | src/bin_expr.py | a49440bfd8542002aee35d41bee093dc8b51d781 | from c_int import Int
from casting import cast
from globals_consts import NAMESPACE
from temps import used_temps, get_temp, get_temp_func
def binary_expression(copy_strings, expression, target, variables_name, vtypes):
from expression import generate_expression
c1, t1, tt1 = generate_expression(None, expressi... | [((286, 377), 'expression.generate_expression', 'generate_expression', (['None', 'expression.left', 'vtypes', 'variables_name', 'copy_strings', '(False)'], {}), '(None, expression.left, vtypes, variables_name,\n copy_strings, False)\n', (305, 377), False, 'from expression import generate_expression\n'), ((392, 484),... |
bobmittmann/yard-ice | tools/mkcodelet.py | 3b27f94279d806d3a222de60adccf934994ed168 | #!/usr/bin/python
from struct import *
from getopt import *
import sys
import os
import re
def usage():
global progname
print >> sys.stderr, ""
print >> sys.stderr, " Usage:", progname, "[options] fname"
print >> sys.stderr, ""
print >> sys.stderr, "Options"
print >> sys.stderr, " -h, --help show... | [] |
MichaelSeeburger/Robot-Framework-Mainframe-3270-Library | utest/x3270/test_screenshot.py | 76b589d58c55a39f96c027a8ae28c41fa37ed445 | import os
from pytest_mock import MockerFixture
from robot.api import logger
from Mainframe3270.x3270 import x3270
def test_set_screenshot_folder(under_test: x3270):
path = os.getcwd()
under_test.set_screenshot_folder(path)
assert under_test.imgfolder == os.getcwd()
def test_set_screenshot_folder_no... | [((181, 192), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (190, 192), False, 'import os\n'), ((559, 648), 'robot.api.logger.error.assert_called_with', 'logger.error.assert_called_with', (['(\'Given screenshots path "%s" does not exist\' % path)'], {}), '(\n \'Given screenshots path "%s" does not exist\' % path)\n', ... |
brackham/splat | splat/photometry.py | 5ee0da82f19017e900ee83af94609dbe9f8a0ea4 | # -*- coding: utf-8 -*-
from __future__ import print_function, division
"""
.. note::
These are the spectrophotometry functions for SPLAT
"""
# imports - internal
import copy
import os
# imports - external
import numpy
from astropy import units as u # standard units
from astropy import constants... | [((895, 914), 'copy.deepcopy', 'copy.deepcopy', (['filt'], {}), '(filt)\n', (908, 914), False, 'import copy\n'), ((12197, 12217), 'numpy.nanstd', 'numpy.nanstd', (['result'], {}), '(result)\n', (12209, 12217), False, 'import numpy\n'), ((13945, 14010), 'scipy.interpolate.interp1d', 'interp1d', (['nu.value', 'fnu.value'... |
mandalorian-101/badger-system | helpers/time_utils.py | 2b0ee9bd77a2cc6f875b9b984ae4dfe713bbc55c | import datetime
ONE_MINUTE = 60
ONE_HOUR = 3600
ONE_DAY = 24 * ONE_HOUR
ONE_YEAR = 1 * 365 * ONE_DAY
def days(days):
return int(days * 86400.0)
def hours(hours):
return int(hours * 3600.0)
def minutes(minutes):
return int(minutes * 60.0)
def to_utc_date(timestamp):
return datetime.datetime.utcfro... | [((296, 341), 'datetime.datetime.utcfromtimestamp', 'datetime.datetime.utcfromtimestamp', (['timestamp'], {}), '(timestamp)\n', (330, 341), False, 'import datetime\n')] |
British-Oceanographic-Data-Centre/NEMO-ENTRUST | example_scripts/profile_validation/plot_validation_gridded_data.py | 41ed278e56428404ab8ec41d74a9a3a761e308ae | """
Plot up surface or bottom (or any fixed level) errors from a profile object
with no z_dim (vertical dimension). Provide an array of netcdf files and
mess with the options to get a figure you like.
You can define how many rows and columns the plot will have. This script will
plot the provided list of netcdf datase... | [((497, 540), 'sys.path.append', 'sys.path.append', (['"""/Users/dbyrne/code/COAsT"""'], {}), "('/Users/dbyrne/code/COAsT')\n", (512, 540), False, 'import sys\n'), ((2685, 2774), 'coast.plot_util.create_geo_subplots', 'coast.plot_util.create_geo_subplots', (['lonbounds', 'latbounds', 'n_r', 'n_c'], {'figsize': 'figsize... |
jeury301/text-classifier | feature-engineering/samples/statistical_features.py | d86f658ef3368e4a3f6fd74328fa862e2881ac3b | from sklearn.feature_extraction.text import TfidfVectorizer
def compute_tf_idf(corpus):
"""Computing term frequency (tf) - inverse document frequency (idf).
:param corpus: List of documents.
:returns: tf-idf of corpus.
"""
return TfidfVectorizer().fit_transform(corpus)
if __name__ == '__main__':
... | [((252, 269), 'sklearn.feature_extraction.text.TfidfVectorizer', 'TfidfVectorizer', ([], {}), '()\n', (267, 269), False, 'from sklearn.feature_extraction.text import TfidfVectorizer\n')] |
hunterpaulson/fprime | Gds/src/fprime_gds/executables/tcpserver.py | 70560897b56dc3037dc966c99751b708b1cc8a05 | #!/usr/bin/env python3
from __future__ import print_function
import socket
import threading
try:
import socketserver
except ImportError:
import SocketServer as socketserver
import time
import os
import signal
import sys
import struct
import errno
from fprime.constants import DATA_ENCODING
from optparse import... | [((477, 494), 'threading.Event', 'threading.Event', ([], {}), '()\n', (492, 494), False, 'import threading\n'), ((14461, 14477), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (14475, 14477), False, 'import threading\n'), ((15310, 15339), 'os.path.basename', 'os.path.basename', (['sys.argv[0]'], {}), '(sys.argv[... |
haivle/BTB-manager-telegram | btb_manager_telegram/__init__.py | c0f71c5a98a3d128ad03578930932737dc580ed1 | import logging
import sched
import time
(
MENU,
EDIT_COIN_LIST,
EDIT_USER_CONFIG,
DELETE_DB,
UPDATE_TG,
UPDATE_BTB,
PANIC_BUTTON,
CUSTOM_SCRIPT,
) = range(8)
BOUGHT, BUYING, SOLD, SELLING = range(4)
logging.basicConfig(
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s"... | [((234, 341), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s - %(name)s - %(levelname)s - %(message)s"""', 'level': 'logging.INFO'}), "(format=\n '%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO)\n", (253, 341), False, 'import logging\n'), ((352, 400), 'loggin... |
brettcannon/modutil | tests/test_data/lazy_mod.py | a34794ffee9b6217a9ced41baddab09b4f034cbb | import modutil
mod, __getattr__ = modutil.lazy_import(__name__,
['tests.test_data.A', '.B', '.C as still_C'])
def trigger_A():
return mod.A
def trigger_B():
return mod.B
def trigger_C():
return mod.still_C
def trigger_failure():
return mod.does_not_exist
| [((36, 111), 'modutil.lazy_import', 'modutil.lazy_import', (['__name__', "['tests.test_data.A', '.B', '.C as still_C']"], {}), "(__name__, ['tests.test_data.A', '.B', '.C as still_C'])\n", (55, 111), False, 'import modutil\n')] |
xiaohuaibaoguigui/EllSeg | test.py | ff56b255f8e650856aec9af23792e105897eba5c | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import tqdm
import torch
import pickle
import resource
import numpy as np
import matplotlib.pyplot as plt
from args import parse_args
from modelSummary import model_dict
from pytorchtools import load_from_file
from torch.utils.data import DataLoader
... | [((615, 657), 'resource.getrlimit', 'resource.getrlimit', (['resource.RLIMIT_NOFILE'], {}), '(resource.RLIMIT_NOFILE)\n', (633, 657), False, 'import resource\n'), ((658, 724), 'resource.setrlimit', 'resource.setrlimit', (['resource.RLIMIT_NOFILE', '(2048 * 10, rlimit[1])'], {}), '(resource.RLIMIT_NOFILE, (2048 * 10, rl... |
meskio/tuf | tests/test_util.py | 09c3ceb993d40f7339bbbaf4eae617f95b972708 | #!/usr/bin/env python
"""
<Program Name>
test_util.py
<Author>
Konstantin Andrianov.
<Started>
February 1, 2013.
<Copyright>
See LICENSE for licensing information.
<Purpose>
Unit test for 'util.py'
"""
# Help with Python 3 compatibility, where the print statement is a function, an
# implicit relative im... | [((840, 874), 'logging.getLogger', 'logging.getLogger', (['"""tuf.test_util"""'], {}), "('tuf.test_util')\n", (857, 874), False, 'import logging\n'), ((21056, 21071), 'unittest.main', 'unittest.main', ([], {}), '()\n', (21069, 21071), False, 'import unittest\n'), ((953, 999), 'tuf.unittest_toolbox.Modified_TestCase.set... |
BFlameSwift/AirplaneReservationSystem | background/forms.py | bbabb0e258c72eb50fcbbf7ade437e38a39e6f02 |
from django import forms
class FlightrForm(forms.Form):
flight_number = forms.CharField(max_length=30, label="航班号", widget=forms.TextInput(attrs={'class': 'form-control'}))
plane_type_choices = [
('波音', (
('1', '747'),
('2', '777'),
('3', '787'),
)
... | [((497, 582), 'django.forms.ChoiceField', 'forms.ChoiceField', ([], {'label': '"""飞机型号"""', 'choices': 'plane_type_choices', 'widget': 'forms.Select'}), "(label='飞机型号', choices=plane_type_choices, widget=forms.Select\n )\n", (514, 582), False, 'from django import forms\n'), ((137, 185), 'django.forms.TextInput', 'fo... |
boliqq07/cam3d | cams/propressing/data_rotate.py | 8b66681166a8ce0ef3304309385c1b899f1d2bb9 | from functools import lru_cache
from math import cos, sin
import scipy
from scipy.ndimage import affine_transform
import numpy as np
@lru_cache(maxsize=10)
def get_matrix(angles=(90, 90, 90), inverse=False):
"""
Axis of rotation Get matrix by angle.
(shear+compress)
Examples: z = 120
######... | [((138, 159), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': '(10)'}), '(maxsize=10)\n', (147, 159), False, 'from functools import lru_cache\n'), ((3378, 3392), 'numpy.zeros', 'np.zeros', (['dims'], {}), '(dims)\n', (3386, 3392), True, 'import numpy as np\n'), ((4170, 4203), 'numpy.array', 'np.array', (['[(i / 2)... |
flange/esp | playground/conversions/parser/lola2dot.py | 78925925daf876e4936ca7af046b4f884e8a4233 | #!/usr/bin/env python
import sys
#lolafile = open("ex-small.graph", "r")
source = 0
target = 0
lowlink = 0
trans = "bla"
print("digraph {")
with open(sys.argv[1]) as lolafile:
for line in lolafile:
if len(line) == 1:
continue
linelist = line.split(" ")
if "STATE" in linelist:
... | [] |
takeshixx/dprkdict | engkor/views.py | 7f436eb99a855ae8037b2219fc97944f5c000f68 | import re
import urllib.parse
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse, JsonResponse
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
from .models import Definition
RE_HANGUL = re.compile(r'[(]*[\uAC00-\uD7AF]+[\uAC00-\uD7AF (),;]*', re.IGNOR... | [((255, 329), 're.compile', 're.compile', (['"""[(]*[\\\\uAC00-\\\\uD7AF]+[\\\\uAC00-\\\\uD7AF (),;]*"""', 're.IGNORECASE'], {}), "('[(]*[\\\\uAC00-\\\\uD7AF]+[\\\\uAC00-\\\\uD7AF (),;]*', re.IGNORECASE)\n", (265, 329), False, 'import re\n'), ((536, 565), 'django.core.paginator.Paginator', 'Paginator', (['definitions',... |
Mithras/ha | appdaemon/apps/toggle_switch/toggle_switch.py | d37f8673eed27a85f76c97ee3e924d2ddc033ee5 | import globals
class ToggleSwitch(globals.Hass):
async def initialize(self):
config = self.args["config"]
self._input = config["input"]
self._toggle_service = config["toggle_service"]
self._toggle_payload = config["toggle_payload"]
self._power = config["power"]
self... | [] |
charlieccarey/rdoc | templates_deepdive_app_bagofwords/udf/dd_extract_features.py | 2e857f29e128f893706d042d583eec698c0bc56a | #!/usr/bin/env python
from __future__ import print_function
'''
1\taaaa~^~bbbb~^~cccc
2\tdddd~^~EEEE~^~ffff
'''
import sys
ARR_DELIM = '~^~'
for row in sys.stdin:
row = row.strip()
sent_id, lemmas = row.split('\t')
lemmas = lemmas.split(ARR_DELIM)
for lemma in lemmas:
print('{}\t{}'.format(s... | [] |
vandana0608/Pharmacy-Managament | src/supplier/templates/supplier/urls.py | f99bdec11c24027a432858daa19247a21cecc092 | from django.urls import path
from . import views
urlpatterns = [
path('', views.SupplierList.as_view(), name='supplier_list'),
path('view/<int:pk>', views.SupplierView.as_view(), name='supplier_view'),
path('new', views.SupplierCreate.as_view(), name='supplier_new'),
path('view/<int:pk>', views.Suppli... | [] |
rarc41/web_scraper_pro | web_scraper/extract/common.py | f297c785617c6b1617ced8f29ad11afec31f2968 | import yaml
__config=None
def config():
global __config
if not __config:
with open('config.yaml', mode='r') as f:
__config=yaml.safe_load(f)
return __config | [((155, 172), 'yaml.safe_load', 'yaml.safe_load', (['f'], {}), '(f)\n', (169, 172), False, 'import yaml\n')] |
infiniteloop98/lazies-cmd | engine/config/constant.py | 46ac58f9b31942c6fa63b7ffa8d409e3a6b4df26 | APP_PROFILE_DIRECTORY_NAME = 'lazies-cmd'
DOSKEY_FILE_NAME = 'doskey.bat'
AUTO_RUN_REGISTRY_NAME = 'AutoRun'
| [] |
fanglu01/cDNA_Cupcake | sequence/get_seqs_from_list.py | 60f56dc291661a2b84e40b64d469fba658889c34 | #!/usr/bin/env python
import os, sys
from Bio import SeqIO
def get_seqs_from_list(fastafile, listfile):
seqs = [line.strip() for line in open(listfile)]
for r in SeqIO.parse(open(fastafile), 'fasta'):
if r.id in seqs or r.id.split('|')[0] in seqs or any(r.id.startswith(x) for x in seqs):
pr... | [] |
cusma/pposdex | ppos_dex_data.py | 31b834ffcb1a43958ccc57b444c7b9337a5623c9 |
import time
import json
import base64
import msgpack
from schema import Schema, And, Optional
from datetime import datetime
from algosdk import mnemonic
from algosdk.account import address_from_private_key
from algosdk.error import *
from algosdk.future.transaction import PaymentTxn
from inequality_indexes import *
fr... | [((1701, 1736), 'algosdk.mnemonic.to_private_key', 'mnemonic.to_private_key', (['passphrase'], {}), '(passphrase)\n', (1724, 1736), False, 'from algosdk import mnemonic\n'), ((4577, 4596), 'msgpack.packb', 'msgpack.packb', (['note'], {}), '(note)\n', (4590, 4596), False, 'import msgpack\n'), ((4617, 4712), 'algosdk.fut... |
Zhengrui-Liu/FireAlarmingSysCDA | src/test/python/programmingtheiot/part01/unit/system/SystemMemUtilTaskTest.py | 26db6375a21ee9bdccba3d137e30d2e63ad6395c | #####
#
# This class is part of the Programming the Internet of Things
# project, and is available via the MIT License, which can be
# found in the LICENSE file at the top level of this repository.
#
# Copyright (c) 2020 by Andrew D. King
#
import logging
import unittest
from programmingtheiot.cda.system.SystemMem... | [((1513, 1528), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1526, 1528), False, 'import unittest\n'), ((702, 806), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s:%(module)s:%(levelname)s:%(message)s"""', 'level': 'logging.DEBUG'}), "(format=\n '%(asctime)s:%(module)s:%(levelna... |
mattclark/osf.io | api/base/settings/defaults.py | 7a362ceb6af3393d3d0423aafef336ee13277303 | """
Django settings for api project.
Generated by 'django-admin startproject' using Django 1.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
import os
from url... | [((7215, 7270), 'os.environ.get', 'os.environ.get', (['"""GOOGLE_APPLICATION_CREDENTIALS"""', '(False)'], {}), "('GOOGLE_APPLICATION_CREDENTIALS', False)\n", (7229, 7270), False, 'import os\n'), ((7747, 7786), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""static/vendor"""'], {}), "(BASE_DIR, 'static/vendor')\n", (7... |
GTedHa/gblackboard | tests/__init__.py | 61c13ca69113019b8fc691acaa1953751f517347 | # -*- coding: utf-8 -*-
"""Unit test package for gblackboard."""
| [] |
RudSmith/beluganos | src/fabricflow/fibc/api/fibcapis_pb2_grpc.py | 7a3f8524e1d9d9313d96476c783a96096180654c | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import fibcapi_pb2 as fibcapi__pb2
import fibcapis_pb2 as fibcapis__pb2
class FIBCApApiStub(object):
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
Args:
... | [((9777, 9855), 'grpc.method_handlers_generic_handler', 'grpc.method_handlers_generic_handler', (['"""fibcapi.FIBCApApi"""', 'rpc_method_handlers'], {}), "('fibcapi.FIBCApApi', rpc_method_handlers)\n", (9813, 9855), False, 'import grpc\n'), ((14833, 14911), 'grpc.method_handlers_generic_handler', 'grpc.method_handlers_... |
pmart123/security_id | cymbology/identifiers/__init__.py | 95087be9525ab8d2fd47baa93f83aaa30e76bb54 | from cymbology.identifiers.sedol import Sedol
from cymbology.identifiers.cusip import Cusip, cusip_from_isin
from cymbology.identifiers.isin import Isin
__all__ = ('Sedol', 'Cusip', 'cusip_from_isin', 'Isin')
| [] |
Noahffiliation/corpus-christi | api/src/error_report/models.py | c69ec88784de7d2e5acde3012926f307b43e38b3 | from marshmallow import Schema, fields
from marshmallow.validate import Range, Length
from sqlalchemy import Column, Integer, Boolean, DateTime
from ..db import Base
from ..shared.models import StringTypes
# ---- Error-report
class ErrorReport(Base):
__tablename__ = 'error_report'
id = Column(Integer, prim... | [((300, 333), 'sqlalchemy.Column', 'Column', (['Integer'], {'primary_key': '(True)'}), '(Integer, primary_key=True)\n', (306, 333), False, 'from sqlalchemy import Column, Integer, Boolean, DateTime\n'), ((352, 399), 'sqlalchemy.Column', 'Column', (['StringTypes.LONG_STRING'], {'nullable': '(False)'}), '(StringTypes.LON... |
arpitran/HackerRank_solutions | Python/Vowel-Substring/solution.py | a3a77c858edd3955ea38530916db9051b1aa93f9 | #!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'findSubstring' function below.
#
# The function is expected to return a STRING.
# The function accepts following parameters:
# 1. STRING s
# 2. INTEGER k
#
def isVowel(x):
if(x=="a" or x=='e' or x=='i' or x=='o' or x=='... | [] |
erichav/NIMA | nima/models/productos/constants.py | 6ca845047e2d1764f07af76bfbbed9f1a82bc10f | COLLECTION = 'productos' | [] |
hsjang001205/deepchem | deepchem/metrics/score_function.py | 02fce35729826b1ef12a1cfa6519b491510217be | """Evaluation metrics."""
import numpy as np
from sklearn.metrics import matthews_corrcoef # noqa
from sklearn.metrics import recall_score # noqa
from sklearn.metrics import cohen_kappa_score
from sklearn.metrics import r2_score # noqa
from sklearn.metrics import mean_squared_error
from sklearn.metrics import mean_... | [((1665, 1689), 'sklearn.metrics.jaccard_score', 'jaccard_score', (['y', 'y_pred'], {}), '(y, y_pred)\n', (1678, 1689), False, 'from sklearn.metrics import jaccard_score\n'), ((2604, 2653), 'sklearn.metrics.precision_recall_curve', 'precision_recall_curve', (['y[:, (1)]', 'y_pred[:, (1)]'], {}), '(y[:, (1)], y_pred[:, ... |
hyperevo/py-helios-node | hvm/chains/base.py | ff417fe3fe90f85c9f95b3d8a5f0dd4c80532ee8 | from __future__ import absolute_import
import operator
from collections import deque
import functools
from abc import (
ABCMeta,
abstractmethod
)
import rlp_cython as rlp
import time
import math
from uuid import UUID
from typing import ( # noqa: F401
Any,
Optional,
Callable,
cast,
Dict,
... | [((18650, 18692), 'logging.getLogger', 'logging.getLogger', (['"""hvm.chain.chain.Chain"""'], {}), "('hvm.chain.chain.Chain')\n", (18667, 18692), False, 'import logging\n'), ((39949, 39980), 'functools.lru_cache', 'functools.lru_cache', ([], {'maxsize': '(32)'}), '(maxsize=32)\n', (39968, 39980), False, 'import functoo... |
Integreat/cms-django | integreat_cms/api/v3/regions.py | ab0a89576ae901f4b30aa8e9c65ff43c44654a80 | """
This module includes functions related to the regions API endpoint.
"""
from django.http import JsonResponse
from ...cms.models import Region
from ...cms.constants import region_status
from ..decorators import json_response
def transform_region(region):
"""
Function to create a JSON from a single region ... | [((2012, 2044), 'django.http.JsonResponse', 'JsonResponse', (['result'], {'safe': '(False)'}), '(result, safe=False)\n', (2024, 2044), False, 'from django.http import JsonResponse\n'), ((2515, 2547), 'django.http.JsonResponse', 'JsonResponse', (['result'], {'safe': '(False)'}), '(result, safe=False)\n', (2527, 2547), F... |
romsok24/epiphany | cli/src/ansible/AnsibleVarsGenerator.py | f058984939561fc8d51288765976118ae12e6c32 | import copy
import os
from cli.src.Config import Config
from cli.src.helpers.build_io import (get_ansible_path,
get_ansible_path_for_build,
get_ansible_vault_path)
from cli.src.helpers.data_loader import (load_all_schema_objs_from_directory,
... | [((2633, 2697), 'os.path.join', 'os.path.join', (['ansible_dir', '"""roles"""', '"""common"""', '"""vars"""', '"""main.yml"""'], {}), "(ansible_dir, 'roles', 'common', 'vars', 'main.yml')\n", (2645, 2697), False, 'import os\n'), ((5307, 5345), 'os.path.join', 'os.path.join', (['vars_dir', 'vars_file_name'], {}), '(vars... |
newtonsspawn/codewars_challenges | Python/4 kyu/Snail/test_snail.py | 62b20d4e729c8ba79eac7cae6a179af57abd45d4 | from unittest import TestCase
from snail import snail
class TestSnail(TestCase):
def test_snail_001(self):
self.assertEqual(snail([[]]), [])
def test_snail_002(self):
self.assertEqual(snail([[1]]), [1])
def test_snail_003(self):
self.assertEqual(snail([[1, 2, 3], [4... | [((144, 155), 'snail.snail', 'snail', (['[[]]'], {}), '([[]])\n', (149, 155), False, 'from snail import snail\n'), ((221, 233), 'snail.snail', 'snail', (['[[1]]'], {}), '([[1]])\n', (226, 233), False, 'from snail import snail\n'), ((300, 340), 'snail.snail', 'snail', (['[[1, 2, 3], [4, 5, 6], [7, 8, 9]]'], {}), '([[1, ... |
cuonglm/tink | python/tink/jwt/_raw_jwt.py | df5fa42e45b4d43aac6c3506ceba2956b79a62b8 | # Copyright 2021 Google LLC
#
# 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, ... | [((1236, 1301), 'datetime.datetime.fromtimestamp', 'datetime.datetime.fromtimestamp', (['timestamp', 'datetime.timezone.utc'], {}), '(timestamp, datetime.timezone.utc)\n', (1267, 1301), False, 'import datetime\n'), ((1089, 1144), 'tink.jwt._jwt_error.JwtInvalidError', '_jwt_error.JwtInvalidError', (['"""datetime must h... |
evernym/indy-plenum | plenum/test/view_change/test_no_instance_change_before_node_is_ready.py | dc390caa16c0b15dcc549d557ede6f64c0c1b842 | import pytest
from plenum.server.view_change.view_changer import ViewChanger
from stp_core.common.log import getlogger
from plenum.test.pool_transactions.helper import start_not_added_node, add_started_node
logger = getlogger()
@pytest.fixture(scope="module", autouse=True)
def tconf(tconf):
old_vc_timeout = tc... | [((219, 230), 'stp_core.common.log.getlogger', 'getlogger', ([], {}), '()\n', (228, 230), False, 'from stp_core.common.log import getlogger\n'), ((234, 278), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""', 'autouse': '(True)'}), "(scope='module', autouse=True)\n", (248, 278), False, 'import pytest\n'... |
tomaszkingukrol/rest-api-cache-proxy | src/cache/requests_cache_abstract.py | 50738f168f36d285b9a924d9f9d106a65b5617c8 | from abc import ABC, abstractclassmethod
from model.response import ResponseModel
class CacheInterface(ABC):
@abstractclassmethod
async def get(cls, url: str) -> ResponseModel: pass
@abstractclassmethod
async def set(cls, url: str, value: ResponseModel, ttl=0): pass
| [] |
cotobadesign/cotoba-agent-oss | dialogue-engine/test/programytest/config/file/test_json.py | 3833d56e79dcd7529c3e8b3a3a8a782d513d9b12 | """
Copyright (c) 2020 COTOBA DESIGN, Inc.
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 use, copy, modify, merge, publish, distri... | [((1485, 1508), 'programy.config.file.json_file.JSONConfigurationFile', 'JSONConfigurationFile', ([], {}), '()\n', (1506, 1508), False, 'from programy.config.file.json_file import JSONConfigurationFile\n'), ((3072, 3095), 'programy.config.file.json_file.JSONConfigurationFile', 'JSONConfigurationFile', ([], {}), '()\n',... |
magnusrodseth/data-structures-and-algorithms | searching/jump_search.py | 45dfdc0859683d5c76b82b87f415e2c0cdbc15e8 | import math
from typing import List
def jump_search(array: List[int], value: int) -> int:
"""
Performs a jump search on a list of integers.
:param array: is the array to search.
:param value: is the value to search.
:return: the index of the value, or -1 if it doesn't exist.'
"""
if len(ar... | [] |
mjneff2/Pincer | pincer/objects/message/sticker.py | a11bc3e4bad319fdf927d913c58c933576ec7c99 | # Copyright Pincer 2021-Present
# Full MIT License can be found in `LICENSE` at the project root.
from __future__ import annotations
from dataclasses import dataclass
from enum import IntEnum
from typing import List, Optional, TYPE_CHECKING
from ...utils.api_object import APIObject
from ...utils.types import MISSING... | [] |
yayunl/llfselfhelp | app/core/utils.py | 55994003ad51e1664a733c84ed6afcb9f28b6499 | from django.views.generic import \
UpdateView as BaseUpdateView
class UpdateView(BaseUpdateView):
template_name_suffix = '_form_update'
| [] |
zhanwj/multi-task-pytorch | demo/test_bug_3d.py | 7d57645ec8be0ca0c258cfa99fb788e3cd37f106 | import torch
import lib.modeling.resnet as resnet
import lib.modeling.semseg_heads as snet
import torch.nn as nn
import torch.optim as optim
import utils.resnet_weights_helper as resnet_utils
from torch.autograd import Variable
from roi_data.loader import RoiDataLoader, MinibatchSampler, collate_minibatch, collate_mini... | [((2264, 2287), 'core.config.cfg_from_file', 'cfg_from_file', (['cfg_file'], {}), '(cfg_file)\n', (2277, 2287), False, 'from core.config import cfg, cfg_from_file, cfg_from_list, assert_and_infer_cfg\n'), ((2788, 2816), 'torch.nn.NLLLoss', 'nn.NLLLoss', ([], {'ignore_index': '(255)'}), '(ignore_index=255)\n', (2798, 28... |
crijke/regenesis | regenesis/modelgen.py | e53a0c6302aa458ff9ae95f573d5594351e5434c | import json
from regenesis.queries import get_cubes, get_all_dimensions, get_dimensions
from pprint import pprint
def generate_dimensions():
dimensions = []
for dimension in get_all_dimensions():
pprint (dimension)
if dimension.get('measure_type').startswith('W-'):
continue
... | [((184, 204), 'regenesis.queries.get_all_dimensions', 'get_all_dimensions', ([], {}), '()\n', (202, 204), False, 'from regenesis.queries import get_cubes, get_all_dimensions, get_dimensions\n'), ((759, 770), 'regenesis.queries.get_cubes', 'get_cubes', ([], {}), '()\n', (768, 770), False, 'from regenesis.queries import ... |
liangleslie/core | tests/components/evil_genius_labs/test_light.py | cc807b4d597daaaadc92df4a93c6e30da4f570c6 | """Test Evil Genius Labs light."""
from unittest.mock import patch
import pytest
from homeassistant.components.light import (
ATTR_COLOR_MODE,
ATTR_SUPPORTED_COLOR_MODES,
ColorMode,
LightEntityFeature,
)
from homeassistant.const import ATTR_SUPPORTED_FEATURES
@pytest.mark.parametrize("platforms", [(... | [((281, 331), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""platforms"""', "[('light',)]"], {}), "('platforms', [('light',)])\n", (304, 331), False, 'import pytest\n'), ((795, 845), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""platforms"""', "[('light',)]"], {}), "('platforms', [('light',)]... |
joshbode/python-on-whales | python_on_whales/download_binaries.py | 4d5b8b4c5c6dc3ac0af5713e4fe5a72788f44cda | import platform
import shutil
import tempfile
import warnings
from pathlib import Path
import requests
from tqdm import tqdm
DOCKER_VERSION = "20.10.5"
BUILDX_VERSION = "0.5.1"
CACHE_DIR = Path.home() / ".cache" / "python-on-whales"
TEMPLATE_CLI = (
"https://download.docker.com/{os}/static/stable/{arch}/docker-... | [((2185, 2215), 'requests.get', 'requests.get', (['url'], {'stream': '(True)'}), '(url, stream=True)\n', (2197, 2215), False, 'import requests\n'), ((2330, 2389), 'tqdm.tqdm', 'tqdm', ([], {'total': 'total_size_in_bytes', 'unit': '"""iB"""', 'unit_scale': '(True)'}), "(total=total_size_in_bytes, unit='iB', unit_scale=T... |
chriscoombs/aws-builders-fair-projects | reinvent-2019/connected-photo-booth/lambda_code/Cerebro_GetQRCode.py | eee405931030b833fa8c51e906c73d09ce051bcd | import boto3
import json
import os
import logging
from contextlib import closing
from boto3.dynamodb.conditions import Key, Attr
from botocore.exceptions import ClientError
from random import shuffle
import time
import pyqrcode
import png
__BUCKET_NAME__ = "project-cerebro"
dynamo = boto3.client('dynamodb')
logg... | [((291, 315), 'boto3.client', 'boto3.client', (['"""dynamodb"""'], {}), "('dynamodb')\n", (303, 315), False, 'import boto3\n'), ((371, 390), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (388, 390), False, 'import logging\n'), ((989, 1007), 'boto3.client', 'boto3.client', (['"""s3"""'], {}), "('s3')\n", (... |
charlesmchen/typefacet | dependencies/svgwrite/tests/test_drawing.py | 8c6db26d0c599ece16f3704696811275120a4044 | #!/usr/bin/env python
#coding:utf-8
# Author: mozman --<mozman@gmx.at>
# Purpose: test drawing module
# Created: 11.09.2010
# Copyright (C) 2010, Manfred Moitzi
# License: GPLv3
from __future__ import unicode_literals
import os
import unittest
from io import StringIO
from svgwrite.drawing import Drawing... | [((4224, 4239), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4237, 4239), False, 'import unittest\n'), ((461, 470), 'svgwrite.drawing.Drawing', 'Drawing', ([], {}), '()\n', (468, 470), False, 'from svgwrite.drawing import Drawing\n'), ((844, 853), 'svgwrite.drawing.Drawing', 'Drawing', ([], {}), '()\n', (851, 8... |
digitalfabrik/coldaid-backend | src/cms/views/error_handler/error_handler.py | b769510570d5921e30876565263813c0362994e2 | from django.shortcuts import render
from django.utils.translation import ugettext as _
# pylint: disable=unused-argument
def handler400(request, exception):
ctx = {'code': 400, 'title': _('Bad request'),
'message': _('There was an error in your request.')}
response = render(request, 'error_handler/... | [((289, 342), 'django.shortcuts.render', 'render', (['request', '"""error_handler/http_error.html"""', 'ctx'], {}), "(request, 'error_handler/http_error.html', ctx)\n", (295, 342), False, 'from django.shortcuts import render\n'), ((612, 665), 'django.shortcuts.render', 'render', (['request', '"""error_handler/http_erro... |
trym-inc/django-msg | examples/ex3/app/models.py | 0b306524515a8fb4840d1a2ef8cf20901b64bc11 | from typing import NamedTuple
from django.contrib.auth.models import AbstractUser
from django.db import models
from msg.models import Msg
class User(AbstractUser):
phone_number: 'str' = models.CharField(max_length=255,
null=True, blank=True)
class HelloSMSMessage(... | [((194, 249), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(255)', 'null': '(True)', 'blank': '(True)'}), '(max_length=255, null=True, blank=True)\n', (210, 249), False, 'from django.db import models\n'), ((704, 737), 'msg.models.Msg.new', 'Msg.new', (['hello'], {'dispatch_now': '(True)'}), '(... |
csixteen/HackerRank | Data_Structures/2d_array_ds.py | 3ef6fa48599341f481b9e266c69df2d449a7b313 | matrix = [list(map(int, input().split())) for _ in range(6)]
max_sum = None
for i in range(4):
for j in range(4):
s = sum(matrix[i][j:j+3]) + matrix[i+1][j+1] + sum(matrix[i+2][j:j+3])
if max_sum is None or s > max_sum:
max_sum = s
print(max_sum)
| [] |
jlopezNEU/scikit-learn | sklearn/utils/_bunch.py | 593495eebc3c2f2ffdb244036adf57fab707a47d | class Bunch(dict):
"""Container object exposing keys as attributes.
Bunch objects are sometimes used as an output for functions and methods.
They extend dictionaries by enabling values to be accessed by key,
`bunch["value_key"]`, or by an attribute, `bunch.value_key`.
Examples
--------
>>>... | [] |
pingsutw/tfx | tfx/examples/chicago_taxi_pipeline/serving/chicago_taxi_client.py | bf0d1d74e3f6ea429989fc7b80b82bea08077857 | # Lint as: python2, python3
# Copyright 2019 Google LLC. 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | [((1670, 1720), 'tensorflow_transform.tf_metadata.dataset_schema.from_feature_spec', 'dataset_schema.from_feature_spec', (['raw_feature_spec'], {}), '(raw_feature_spec)\n', (1702, 1720), False, 'from tensorflow_transform.tf_metadata import dataset_schema\n'), ((1730, 1770), 'tensorflow_transform.coders.ExampleProtoCode... |
BlackIQ/Cute | PyVideo/main.py | 5835e989d661f23b04b6e436589c6e844167522e | from PyQt5.QtCore import (pyqtSignal, pyqtSlot, Q_ARG, QAbstractItemModel,
QFileInfo, qFuzzyCompare, QMetaObject, QModelIndex, QObject, Qt,
QThread, QTime, QUrl)
from PyQt5.QtGui import QColor, qGray, QImage, QPainter, QPalette
from PyQt5.QtMultimedia import (QAbstractVideoBuffer, QMediaContent,
... | [((4307, 4319), 'PyQt5.QtCore.pyqtSignal', 'pyqtSignal', ([], {}), '()\n', (4317, 4319), False, 'from PyQt5.QtCore import pyqtSignal, pyqtSlot, Q_ARG, QAbstractItemModel, QFileInfo, qFuzzyCompare, QMetaObject, QModelIndex, QObject, Qt, QThread, QTime, QUrl\n'), ((4332, 4344), 'PyQt5.QtCore.pyqtSignal', 'pyqtSignal', ([... |
Uornca/mirheo | tests/snapshot/periodic.py | 162c722ffa27c02e1f5b0d1866816e44c2393f0f | #!/usr/bin/env python
"""Test checkpoint-like periodic snapshots.
We test that there are that many folders and that the currentStep changes.
"""
import mirheo as mir
u = mir.Mirheo(nranks=(1, 1, 1), domain=(4, 6, 8), debug_level=3,
log_filename='log', no_splash=True,
checkpoint_every=1... | [((174, 420), 'mirheo.Mirheo', 'mir.Mirheo', ([], {'nranks': '(1, 1, 1)', 'domain': '(4, 6, 8)', 'debug_level': '(3)', 'log_filename': '"""log"""', 'no_splash': '(True)', 'checkpoint_every': '(10)', 'checkpoint_mode': '"""Incremental"""', 'checkpoint_folder': '"""periodic_snapshots/snapshot_"""', 'checkpoint_mechanism'... |
xzhan96/chromium.src | tools/resource_prefetch_predictor/generate_database.py | 1bd0cf3997f947746c0fc5406a2466e7b5f6159e | #!/usr/bin/python
#
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Loads a set of web pages several times on a device, and extracts the
predictor database.
"""
import argparse
import logging
import os... | [((446, 505), 'os.path.join', 'os.path.join', (['_SRC_PATH', '"""third_party"""', '"""catapult"""', '"""devil"""'], {}), "(_SRC_PATH, 'third_party', 'catapult', 'devil')\n", (458, 505), False, 'import os\n'), ((564, 607), 'os.path.join', 'os.path.join', (['_SRC_PATH', '"""build"""', '"""android"""'], {}), "(_SRC_PATH, ... |
madeline-scyphers/palm | palm_wrapper/job_submission/domain.py | 0ecf9eb49f66b86f284bac9506c9570159aba02b | from abc import ABC, abstractmethod
from typing import Optional
from xml import dom
import numpy as np
import pandas as pd
from .utils import get_factors_rev
def calc_plot_size(domain_x, domain_y, plot_goal, house_goal):
f1 = sorted(get_factors_rev(domain_x))
f2 = sorted(get_factors_rev(domain_y))
plot_... | [((1874, 1945), 'pandas.DataFrame', 'pd.DataFrame', (['plots'], {'columns': "['px', 'py', 'domx', 'domy', 'trimmed_dy']"}), "(plots, columns=['px', 'py', 'domx', 'domy', 'trimmed_dy'])\n", (1886, 1945), True, 'import pandas as pd\n'), ((4922, 4965), 'numpy.savetxt', 'np.savetxt', (['filename', 'matrix'], {'delimiter': ... |
Alba126/Laba21 | zad5.py | ce5735ca223d92287efa64bc3347f4356234b399 | #!/usr/bin/env python3
# -*- config: utf-8 -*-
from tkinter import *
from random import random
def on_click():
x = random()
y = random()
bt1.place(relx=x, rely=y)
root = Tk()
root['bg'] = 'white'
root.title('crown')
img = PhotoImage(file='crown.png')
bt1 = Button(image=img, command=on_click)
bt1.place... | [((122, 130), 'random.random', 'random', ([], {}), '()\n', (128, 130), False, 'from random import random\n'), ((139, 147), 'random.random', 'random', ([], {}), '()\n', (145, 147), False, 'from random import random\n')] |
HumanCellAtlas/ingest-common | tests/importer/utils/test_utils.py | 6a230f9606f64cd787b67c143854db36e012a2b7 | from openpyxl import Workbook
def create_test_workbook(*worksheet_titles, include_default_sheet=False):
workbook = Workbook()
for title in worksheet_titles:
workbook.create_sheet(title)
if not include_default_sheet:
default_sheet = workbook['Sheet']
workbook.remove(default_sheet)
... | [((121, 131), 'openpyxl.Workbook', 'Workbook', ([], {}), '()\n', (129, 131), False, 'from openpyxl import Workbook\n')] |
WBobby/pytorch | test/test_import_stats.py | 655960460ccca936fa5c06df6bbafd25b5582115 | import subprocess
import sys
import unittest
import pathlib
from torch.testing._internal.common_utils import TestCase, run_tests, IS_LINUX, IS_IN_CI
REPO_ROOT = pathlib.Path(__file__).resolve().parent.parent
try:
# Just in case PyTorch was not built in 'develop' mode
sys.path.append(str(REPO_ROOT))
from... | [((1010, 1084), 'unittest.skipIf', 'unittest.skipIf', (['(not IS_LINUX)', '"""Memory test is only implemented for Linux"""'], {}), "(not IS_LINUX, 'Memory test is only implemented for Linux')\n", (1025, 1084), False, 'import unittest\n'), ((1090, 1150), 'unittest.skipIf', 'unittest.skipIf', (['(not IS_IN_CI)', '"""Memo... |
fasih/django-post_office | post_office/validators.py | e4086527a48bc0d1e5b8e0dfe9c27ab3a6260224 | from django.core.exceptions import ValidationError
from django.core.validators import validate_email
from django.template import Template, TemplateSyntaxError, TemplateDoesNotExist
from django.utils.encoding import force_str
def validate_email_with_name(value):
"""
Validate email address.
Both "Recipient... | [((402, 418), 'django.utils.encoding.force_str', 'force_str', (['value'], {}), '(value)\n', (411, 418), False, 'from django.utils.encoding import force_str\n'), ((616, 641), 'django.core.validators.validate_email', 'validate_email', (['recipient'], {}), '(recipient)\n', (630, 641), False, 'from django.core.validators i... |
GiuseppeBaldini/PaperHub | paperhub/input.py | 5efdee1a0374c995a6717a4baee2106df808af12 | # Input DOI / URL
import re
import sys
# Pyperclip is not built-in, check and download if needed
try:
import pyperclip
except (ImportError, ModuleNotFoundError):
print('Pyperclip module not found. Please download it.')
sys.exit(0)
# Regex for links
link_regex = re.compile(r'''(
http[s]?://
(?:[a-... | [((277, 450), 're.compile', 're.compile', (['"""(\n http[s]?://\n (?:[a-zA-Z]|\n [0-9]|\n [$-_@.&+]|\n [!*\\\\(\\\\),]|\n (?:%[0-9a-fA-F][0-9a-fA-F]))+\n )"""', '(re.IGNORECASE | re.VERBOSE)'], {}), '(\n """(\n http[s]?://\n (?:[a-zA-Z]|\n [0-9]|\n [$-_@.&+]|\n [!*\\\\(\\\\),]|\n ... |
chillum1718/EffcientNetV2 | main.py | 4338652454185db648a6ea5df04528bcafb24ed2 | import argparse
import csv
import os
import torch
import tqdm
from torch import distributed
from torch.utils import data
from torchvision import datasets
from torchvision import transforms
from nets import nn
from utils import util
data_dir = os.path.join('..', 'Dataset', 'IMAGENET')
def batch(images, target, mode... | [((246, 287), 'os.path.join', 'os.path.join', (['""".."""', '"""Dataset"""', '"""IMAGENET"""'], {}), "('..', 'Dataset', 'IMAGENET')\n", (258, 287), False, 'import os\n'), ((661, 686), 'utils.util.set_seeds', 'util.set_seeds', (['args.rank'], {}), '(args.rank)\n', (675, 686), False, 'from utils import util\n'), ((883, 8... |
duartegroup/cgbind | cgbind/esp.py | 8c2369d4c49e8b008fc3951719d99e0c4f6b6b16 | import numpy as np
from time import time
from cgbind.atoms import get_atomic_number
from cgbind.log import logger
from cgbind.constants import Constants
from cgbind.exceptions import CgbindCritical
def get_esp_cube_lines(charges, atoms):
"""
From a list of charges and a set of xyzs create the electrostatic po... | [((581, 643), 'cgbind.log.logger.info', 'logger.info', (['"""Calculating the ESP and generating a .cube file"""'], {}), "('Calculating the ESP and generating a .cube file')\n", (592, 643), False, 'from cgbind.log import logger\n'), ((661, 667), 'time.time', 'time', ([], {}), '()\n', (665, 667), False, 'from time import... |
mcdenoising/AdvMCDenoise | codes/test_specular.py | 4ba00098c2d0f50a7dfc1e345b5e50a20768d7e8 | import os
import sys
import logging
import time
import argparse
import numpy as np
from collections import OrderedDict
import scripts.options as option
import utils.util as util
from data.util import bgr2ycbcr
from data import create_dataset, create_dataloader
from models import create_model
# options
parser = argpar... | [((314, 339), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (337, 339), False, 'import argparse\n'), ((584, 612), 'scripts.options.dict_to_nonedict', 'option.dict_to_nonedict', (['opt'], {}), '(opt)\n', (607, 612), True, 'import scripts.options as option\n'), ((614, 706), 'utils.util.setup_log... |
zzw0929/deeplearning | neuralNetwork/layer3/nerualNet.py | d96aadd71838fa60a4c031b13fe475d4839e8a33 | # coding:utf-8
import time
import matplotlib.pyplot as plt
import numpy as np
import sklearn
import sklearn.datasets
import sklearn.linear_model
import matplotlib
matplotlib.rcParams['figure.figsize'] = (10.0, 8.0)
np.random.seed(0)
X, y = sklearn.datasets.make_moons(200, noise=0.20)
plt.scatter(X[:,0], X[:,1], s=40... | [((218, 235), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (232, 235), True, 'import numpy as np\n'), ((243, 286), 'sklearn.datasets.make_moons', 'sklearn.datasets.make_moons', (['(200)'], {'noise': '(0.2)'}), '(200, noise=0.2)\n', (270, 286), False, 'import sklearn\n'), ((288, 354), 'matplotlib.pyplo... |
Lifeistrange/flaskweb | app/domain/create_db.py | 6226e9f546d96d5f0a8f11104a37849e8f16ce80 | #!/usr/bin/env python
# coding=utf-8
from manage import db
import app.domain.model
db.create_all()
| [((85, 100), 'manage.db.create_all', 'db.create_all', ([], {}), '()\n', (98, 100), False, 'from manage import db\n')] |
TimoRoth/tljh-repo2docker | tljh_repo2docker/tests/utils.py | 35e7e940266de0490990acc780b64802afe973c1 | import asyncio
import json
from aiodocker import Docker, DockerError
from jupyterhub.tests.utils import api_request
async def add_environment(
app, *, repo, ref="master", name="", memory="", cpu=""
):
"""Use the POST endpoint to add a new environment"""
r = await api_request(
app,
"enviro... | [((637, 645), 'aiodocker.Docker', 'Docker', ([], {}), '()\n', (643, 645), False, 'from aiodocker import Docker, DockerError\n'), ((365, 451), 'json.dumps', 'json.dumps', (["{'repo': repo, 'ref': ref, 'name': name, 'memory': memory, 'cpu': cpu}"], {}), "({'repo': repo, 'ref': ref, 'name': name, 'memory': memory, 'cpu':\... |
CrispenGari/python-flask | 05_ARIADNE_SUBSCRIPTIONS_GRAPHQL/api/resolvers/mutations/__init__.py | 3e7896f401920b8dd045d807212ec24b8353a75a |
from api import db
from uuid import uuid4
from ariadne import MutationType
from api.models import Post
from api.store import queues
mutation = MutationType()
@mutation.field("createPost")
async def create_post_resolver(obj, info, input):
try:
post = Post(postId=uuid4(), caption=input["caption"])
... | [((145, 159), 'ariadne.MutationType', 'MutationType', ([], {}), '()\n', (157, 159), False, 'from ariadne import MutationType\n'), ((320, 340), 'api.db.session.add', 'db.session.add', (['post'], {}), '(post)\n', (334, 340), False, 'from api import db\n'), ((349, 368), 'api.db.session.commit', 'db.session.commit', ([], {... |
justengel/async_sched | async_sched/client/__init__.py | f980722d51d15025522b2265426b0188ff368418 | from async_sched.client import quit_server as module_quit
from async_sched.client import request_schedules as module_request
from async_sched.client import run_command as module_run
from async_sched.client import schedule_command as module_schedule
from async_sched.client import stop_schedule as module_stop
from async_... | [] |
t4d-classes/angular_02212022 | full-stack-angular-ngrx/backend/src/core/interfaces/crud.py | 152dfa4b14ee84c1c34cef0b852349b250103e3b | import abc
from typing import TypeVar, Generic, List, Dict
T = TypeVar('T')
class CRUDInterface(Generic[T], metaclass=abc.ABCMeta):
@abc.abstractmethod
def all(self) -> List[T]:
pass
@abc.abstractmethod
def one_by_id(self, entity_id: int) -> T:
pass
@abc.abstractmethod
def ... | [((64, 76), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (71, 76), False, 'from typing import TypeVar, Generic, List, Dict\n')] |
MrKriss/stonemason | package/tests/test_init_command.py | d78becc9168c2566b31b48c9a951e2823bc98362 |
from pathlib import Path
import pytest
import git
import json
from conftest import TEST_DIR
def test_init_with_project(tmpdir):
output_path = Path(tmpdir.strpath)
# Set arguments
args = f"init -o {output_path} {TEST_DIR}/example_templates/python_project"
from masonry import main
# Run from en... | [((151, 171), 'pathlib.Path', 'Path', (['tmpdir.strpath'], {}), '(tmpdir.strpath)\n', (155, 171), False, 'from pathlib import Path\n'), ((334, 354), 'masonry.main.main', 'main.main', ([], {'args': 'args'}), '(args=args)\n', (343, 354), False, 'from masonry import main\n'), ((1311, 1331), 'pathlib.Path', 'Path', (['tmpd... |
Toure/openstack_mistral_wip | mistral/mistral/api/controllers/v2/service.py | 1c3d028cb7c918de74a3cb018c84d6c5ee42e3f1 | # Copyright 2015 Huawei Technologies Co., Ltd.
#
# 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... | [((1153, 1180), 'oslo_log.log.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1170, 1180), True, 'from oslo_log import log as logging\n'), ((1282, 1321), 'wsmeext.pecan.wsexpose', 'wsme_pecan.wsexpose', (['resources.Services'], {}), '(resources.Services)\n', (1301, 1321), True, 'import wsmeext.pec... |
jtauber/greek-utils | setup.py | 1da19a5a784c4dac9d205ae1afdc5516ddcae9b4 | from setuptools import setup
setup(
name="greek-utils",
version="0.2",
description="various utilities for processing Ancient Greek",
license="MIT",
url="http://github.com/jtauber/greek-utils",
author="James Tauber",
author_email="jtauber@jtauber.com",
packages=["greekutils"],
classi... | [((30, 665), 'setuptools.setup', 'setup', ([], {'name': '"""greek-utils"""', 'version': '"""0.2"""', 'description': '"""various utilities for processing Ancient Greek"""', 'license': '"""MIT"""', 'url': '"""http://github.com/jtauber/greek-utils"""', 'author': '"""James Tauber"""', 'author_email': '"""jtauber@jtauber.co... |
jfilter/foia-bot | source/tweet.py | 11a9e31116dddfcd7bbd17730be3bdb9cec65e27 | """
tweet stuff in intervals
"""
import time
import datetime
import twitter
from markov_chains import german_text
from config import config_no, config_yes
MAX_TWEET_LENGTH = 280
greeting = ' Sehr geehrte/r Anstragssteller/in.'
ending = ' MfG'
num_tweets = 3
class FoiaBot:
def __init__(self, config):
s... | [((330, 553), 'twitter.Api', 'twitter.Api', ([], {'consumer_key': "config['consumer_key']", 'consumer_secret': "config['consumer_secret']", 'access_token_key': "config['access_token']", 'access_token_secret': "config['access_token_secret']", 'sleep_on_rate_limit': '(True)'}), "(consumer_key=config['consumer_key'], cons... |
amitjoshi9627/Playong | account_processing.py | d54a8db05ae5035e122b8bc8d84c849f25483005 | from selenium.webdriver import Firefox
from selenium.webdriver.firefox.options import Options
import getpass
import time
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
from utils import *
def login_user(browser, email='', password=''):
print('Redir... | [((645, 658), 'time.sleep', 'time.sleep', (['(4)'], {}), '(4)\n', (655, 658), False, 'import time\n'), ((899, 920), 'selenium.webdriver.common.action_chains.ActionChains', 'ActionChains', (['browser'], {}), '(browser)\n', (911, 920), False, 'from selenium.webdriver.common.action_chains import ActionChains\n'), ((1152, ... |
RafaelSdm/Curso-de-Python | Mundo 3/teste.py | ae933ba80ee00ad5160bd5d05cf4b21007943fd4 | pessoas = {'nomes': "Rafael","sexo":"macho alfa","idade":19}
print(f"o {pessoas['nomes']} que se considera um {pessoas['sexo']} possui {pessoas['idade']}")
print(pessoas.keys())
print(pessoas.values())
print(pessoas.items())
for c in pessoas.keys():
print(c)
for c in pessoas.values():
print(c)
for c, j in pe... | [] |
mumbo-pro/cyrptography-algorithm | rsa-cipher/makeRsaKeys.py | 8e08c027c361f94c547f8b4ede723401399c93ed | # RSA Key Generator
2. # http://inventwithpython.com/hacking (BSD Licensed) 3. 4. import random, sys, os, rabinMiller, cryptomath
The program imports the rabinMiller and cryptomath modules that we created in the last chapter, along with a few others.
Chapter 24 – Public Key Cryptography and the RSA Cipher 387... | [] |
Harvard-Neutrino/phys145 | atlas-outreach-data-tools-framework-1.1/Configurations/PlotConf_TTbarAnalysis.py | c3dc5788128fa2a7db0af0c796cf3afd957bf0ed | config = {
"Luminosity": 1000,
"InputDirectory": "results",
"Histograms" : {
"WtMass" : {},
"etmiss" : {},
"lep_n" : {},
"lep_pt" : {},
"lep_eta" : {},
"lep_E" : {},
"lep_phi" : {"y_margin" : 0.6},
"lep_... | [] |
OMGhozlan/deobshell | modules/optimizations/dead_codes.py | 701c8a09f9258442255013605185ed0a7fbac704 | # coding=utf-8
from ..logger import log_debug
from ..utils import parent_map, replace_node, is_prefixed_var, get_used_vars
def opt_unused_variable(ast):
parents = parent_map(ast)
used_vars = get_used_vars(ast)
for node in ast.iter():
if node.tag in ["AssignmentStatementAst"]:
subnodes... | [] |
RijuDasgupta9116/LintCode | Convert Integer A to Integer B.py | 4629a3857b2c57418b86a3b3a7180ecb15e763e3 | """
Determine the number of bits required to convert integer A to integer B
Example
Given n = 31, m = 14,return 2
(31)10=(11111)2
(14)10=(01110)2
"""
__author__ = 'Danyang'
class Solution:
def bitSwapRequired(self, a, b):
"""
:param a:
:param b:
:return: int
"""
... | [] |
myriadrf/pyLMS7002M | examples/basic/findQSpark.py | b866deea1f05dba44c9ed1a1a4666352b811b66b | from pyLMS7002M import *
print("Searching for QSpark...")
try:
QSpark = QSpark()
except:
print("QSpark not found")
exit(1)
print("\QSpark info:")
QSpark.printInfo() # print the QSpark board info
# QSpark.LMS7002_Reset() # reset the LMS7002M
lms700... | [] |
paradxum/django-macaddress | macaddress/__init__.py | c223dc8c79555d2265789c4d13667036cfbd7bd8 | from django.conf import settings
from netaddr import mac_unix, mac_eui48
import importlib
import warnings
class mac_linux(mac_unix):
"""MAC format with zero-padded all upper-case hex and colon separated"""
word_fmt = '%.2X'
def default_dialect(eui_obj=None):
# Check to see if a default dialect class has... | [((2348, 2385), 'pkg_resources.get_distribution', 'get_distribution', (['"""django-macaddress"""'], {}), "('django-macaddress')\n", (2364, 2385), False, 'from pkg_resources import get_distribution, DistributionNotFound\n'), ((825, 871), 'django.conf.settings.MACADDRESS_DEFAULT_DIALECT.split', 'settings.MACADDRESS_DEFAU... |
dfstrauss/textmagic-sms-api-python | textmagic/test/message_status_tests.py | 9ab05b461861ac53da651588bef6b0b504653ecd | import time
from textmagic.test import ONE_TEST_NUMBER
from textmagic.test import THREE_TEST_NUMBERS
from textmagic.test import TextMagicTestsBase
from textmagic.test import LiveUnsafeTests
class MessageStatusTestsBase(TextMagicTestsBase):
def sendAndCheckStatusTo(self, numbers):
message = 'sdfqwersdfg... | [] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.