hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
790843272d4c56a5b15a6c0691204d0cfaecea76 | 1,459 | py | Python | Configuration/GenProduction/python/ThirteenTeV/GMSB_noSLHA/GMSB_L350TeV_Ctau400cm_Pythia8_13TeV_cff.py | zhangzc11/cms-gmsb-sps8-configs | 838e6aac1d13251e050c0ee8c4ed26ca0c6cef7e | [
"Apache-2.0"
] | null | null | null | Configuration/GenProduction/python/ThirteenTeV/GMSB_noSLHA/GMSB_L350TeV_Ctau400cm_Pythia8_13TeV_cff.py | zhangzc11/cms-gmsb-sps8-configs | 838e6aac1d13251e050c0ee8c4ed26ca0c6cef7e | [
"Apache-2.0"
] | null | null | null | Configuration/GenProduction/python/ThirteenTeV/GMSB_noSLHA/GMSB_L350TeV_Ctau400cm_Pythia8_13TeV_cff.py | zhangzc11/cms-gmsb-sps8-configs | 838e6aac1d13251e050c0ee8c4ed26ca0c6cef7e | [
"Apache-2.0"
] | null | null | null | with open("/cvmfs/cms.cern.ch/phys_generator/gridpacks/slc6_amd64_gcc481/13TeV/madgraph/GMSB_SHLA/GMSB_Lambda350TeV_CTau400cm.slha") as f:
SLHA_TABLE = f.read()
import FWCore.ParameterSet.Config as cms
from Configuration.Generator.Pythia8CommonSettings_cfi import *
from Configuration.Generator.MCTunes2017.PythiaCP5... | 42.911765 | 138 | 0.632625 | with open("/cvmfs/cms.cern.ch/phys_generator/gridpacks/slc6_amd64_gcc481/13TeV/madgraph/GMSB_SHLA/GMSB_Lambda350TeV_CTau400cm.slha") as f:
SLHA_TABLE = f.read()
import FWCore.ParameterSet.Config as cms
from Configuration.Generator.Pythia8CommonSettings_cfi import *
from Configuration.Generator.MCTunes2017.PythiaCP5... | true | true |
7908440e92b1d4474e49dd13dab36db956ff6086 | 16,282 | py | Python | homeassistant/helpers/entity_platform.py | leloberg/Home-Assistant | 5800b57791ac7767d19a50dcd07ea40353d925fc | [
"Apache-2.0"
] | 1 | 2019-05-29T15:43:01.000Z | 2019-05-29T15:43:01.000Z | homeassistant/helpers/entity_platform.py | leloberg/Home-Assistant | 5800b57791ac7767d19a50dcd07ea40353d925fc | [
"Apache-2.0"
] | null | null | null | homeassistant/helpers/entity_platform.py | leloberg/Home-Assistant | 5800b57791ac7767d19a50dcd07ea40353d925fc | [
"Apache-2.0"
] | null | null | null | """Class to manage the entities for a single platform."""
import asyncio
from homeassistant.const import DEVICE_DEFAULT_NAME
from homeassistant.core import callback, valid_entity_id, split_entity_id
from homeassistant.exceptions import HomeAssistantError, PlatformNotReady
from homeassistant.util.async_ import (
ru... | 38.491726 | 78 | 0.605577 | import asyncio
from homeassistant.const import DEVICE_DEFAULT_NAME
from homeassistant.core import callback, valid_entity_id, split_entity_id
from homeassistant.exceptions import HomeAssistantError, PlatformNotReady
from homeassistant.util.async_ import (
run_callback_threadsafe, run_coroutine_threadsafe)
from .ev... | true | true |
79084464af6581fe0ffd17abdc5d4d350d5b94cb | 889 | py | Python | web/src/additional_settings/celery_settings.py | SilinAlexander/django-chat | 11e59209d478469bd3ea91a0f3c7a504ff34758f | [
"MIT"
] | 4 | 2021-03-11T07:37:36.000Z | 2021-09-19T07:58:41.000Z | web/src/additional_settings/celery_settings.py | SilinAlexander/django-chat | 11e59209d478469bd3ea91a0f3c7a504ff34758f | [
"MIT"
] | 1 | 2021-11-21T07:48:41.000Z | 2021-11-21T07:48:41.000Z | web/src/additional_settings/celery_settings.py | SilinAlexander/django-chat | 11e59209d478469bd3ea91a0f3c7a504ff34758f | [
"MIT"
] | 6 | 2021-03-24T09:01:23.000Z | 2021-09-18T13:16:34.000Z | from os import environ
from kombu import Queue, Exchange
CELERY_BROKER_URL = environ.get('CELERY_BROKER_URL')
CELERY_RESULT_BACKEND = environ.get('CELERY_RESULT_BACKEND')
CELERY_TIMEZONE = environ.get('TZ', 'UTC')
CELERY_RESULT_PERSISTENT = True
CELERY_TASK_TRACK_STARTED = True
CELERY_TASK_TIME_LIMIT = 30 * 60
CELER... | 24.694444 | 88 | 0.752531 | from os import environ
from kombu import Queue, Exchange
CELERY_BROKER_URL = environ.get('CELERY_BROKER_URL')
CELERY_RESULT_BACKEND = environ.get('CELERY_RESULT_BACKEND')
CELERY_TIMEZONE = environ.get('TZ', 'UTC')
CELERY_RESULT_PERSISTENT = True
CELERY_TASK_TRACK_STARTED = True
CELERY_TASK_TIME_LIMIT = 30 * 60
CELER... | true | true |
790844811447283f2df1dd50ec47b51a56591b0b | 1,110 | py | Python | web/src/views/home.py | TexAgg/MarkovTextGenerator | ed1b260da8cd6a015a422a332102c34226de52ba | [
"MIT"
] | 3 | 2016-08-20T02:10:57.000Z | 2019-02-04T21:12:47.000Z | web/src/views/home.py | TexAgg/MarkovTextGenerator | ed1b260da8cd6a015a422a332102c34226de52ba | [
"MIT"
] | null | null | null | web/src/views/home.py | TexAgg/MarkovTextGenerator | ed1b260da8cd6a015a422a332102c34226de52ba | [
"MIT"
] | null | null | null | from markovp import Markov
from src.forms import Markov_Form
from flask import Flask, render_template, request, redirect, url_for, Blueprint, make_response
home = Blueprint("home", __name__)
@home.route("/")
def index():
#{
form = Markov_Form()
return render_template('form.html', form = form)
#}
# The submis... | 27.073171 | 94 | 0.583784 | from markovp import Markov
from src.forms import Markov_Form
from flask import Flask, render_template, request, redirect, url_for, Blueprint, make_response
home = Blueprint("home", __name__)
@home.route("/")
def index():
form = Markov_Form()
return render_template('form.html', form = form)
@home.route("/s... | true | true |
7908450aafd9c882d841fbba45ec21f1cc39ded1 | 2,429 | py | Python | neuwon/database/examples/life/model.py | ctrl-z-9000-times/NEUWON | ed5c13f8cecfd638dd0952d231c36f48073a64a6 | [
"MIT"
] | 3 | 2020-12-26T02:26:28.000Z | 2022-03-30T05:54:13.000Z | neuwon/database/examples/life/model.py | ctrl-z-9000-times/NEUWON | ed5c13f8cecfd638dd0952d231c36f48073a64a6 | [
"MIT"
] | null | null | null | neuwon/database/examples/life/model.py | ctrl-z-9000-times/NEUWON | ed5c13f8cecfd638dd0952d231c36f48073a64a6 | [
"MIT"
] | null | null | null | from neuwon.database import Database
import numpy as np
import numba
class GameOfLife:
class _CellBaseClass:
__slots__ = ()
@classmethod
def _add_to_database(cls, database):
cell_data = database.add_class("Cell", cls)
cell_data.add_attribute("coordinates", shape=(2,... | 35.720588 | 78 | 0.516674 | from neuwon.database import Database
import numpy as np
import numba
class GameOfLife:
class _CellBaseClass:
__slots__ = ()
@classmethod
def _add_to_database(cls, database):
cell_data = database.add_class("Cell", cls)
cell_data.add_attribute("coordinates", shape=(2,... | true | true |
790846053db966a21b7b6b346852f1e665469c3b | 2,730 | py | Python | src/openprocurement/planning/api/views/plan_milestone_document.py | pontostroy/api | 5afdd3a62a8e562cf77e2d963d88f1a26613d16a | [
"Apache-2.0"
] | 3 | 2020-03-13T06:44:23.000Z | 2020-11-05T18:25:29.000Z | src/openprocurement/planning/api/views/plan_milestone_document.py | pontostroy/api | 5afdd3a62a8e562cf77e2d963d88f1a26613d16a | [
"Apache-2.0"
] | 2 | 2021-03-25T23:29:58.000Z | 2022-03-21T22:18:37.000Z | src/openprocurement/planning/api/views/plan_milestone_document.py | scrubele/prozorro-testing | 42b93ea2f25d8cc40e66c596f582c7c05e2a9d76 | [
"Apache-2.0"
] | 3 | 2020-10-16T16:25:14.000Z | 2021-05-22T12:26:20.000Z | # -*- coding: utf-8 -*-
from openprocurement.planning.api.utils import opresource
from openprocurement.api.utils import get_now, context_unpack, json_view
from openprocurement.planning.api.validation import validate_plan_not_terminated
from openprocurement.api.validation import validate_file_update, validate_file_uploa... | 38.450704 | 115 | 0.684615 |
from openprocurement.planning.api.utils import opresource
from openprocurement.api.utils import get_now, context_unpack, json_view
from openprocurement.planning.api.validation import validate_plan_not_terminated
from openprocurement.api.validation import validate_file_update, validate_file_upload, validate_patch_docum... | true | true |
790846295bb8eb919ad9b04bfde59a7401e0f7d3 | 9,265 | py | Python | pythia/utils/checkpoint.py | zean-wen/mmgnn_textvqa | 2cfe82ed54610975a1d4937f2032e5f4565ecbe7 | [
"BSD-3-Clause"
] | 35 | 2020-03-06T13:05:17.000Z | 2021-07-30T15:12:00.000Z | pythia/utils/checkpoint.py | zean-wen/mmgnn_textvqa | 2cfe82ed54610975a1d4937f2032e5f4565ecbe7 | [
"BSD-3-Clause"
] | 1 | 2021-01-12T01:45:54.000Z | 2021-03-17T00:44:47.000Z | pythia/utils/checkpoint.py | zean-wen/mmgnn_textvqa | 2cfe82ed54610975a1d4937f2032e5f4565ecbe7 | [
"BSD-3-Clause"
] | 11 | 2020-03-07T08:10:15.000Z | 2021-06-24T05:39:36.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
import os
import warnings
# import git
import torch
import yaml
from pythia.common.registry import registry
from pythia.utils.distributed_utils import is_main_process, synchronize
from pythia.utils.general import (ckpt_name_from_core_args,
... | 37.510121 | 120 | 0.586508 |
import os
import warnings
import torch
import yaml
from pythia.common.registry import registry
from pythia.utils.distributed_utils import is_main_process, synchronize
from pythia.utils.general import (ckpt_name_from_core_args,
foldername_from_config_override, updir)
class Checkpo... | true | true |
7908471290734f2e18358242cb73a530aa165830 | 1,709 | py | Python | examples/house_example.py | ntezak/plotille | 7baa4fa176ced99f7a9ab9688e99b525ef3edf4d | [
"MIT"
] | 157 | 2017-09-28T12:16:52.000Z | 2022-03-31T08:13:23.000Z | examples/house_example.py | ntezak/plotille | 7baa4fa176ced99f7a9ab9688e99b525ef3edf4d | [
"MIT"
] | 43 | 2017-11-01T19:21:21.000Z | 2022-03-27T08:36:56.000Z | examples/house_example.py | ntezak/plotille | 7baa4fa176ced99f7a9ab9688e99b525ef3edf4d | [
"MIT"
] | 12 | 2018-01-14T08:05:07.000Z | 2021-07-31T05:15:38.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
# The MIT License
# Copyright (c) 2017 - 2021 Tammo Ippen, tammo.ippen@posteo.de
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation fi... | 37.152174 | 82 | 0.716793 |
from __future__ import absolute_import, division, print_function, unicode_literals
from plotille import Canvas
def main():
c = Canvas(width=40, height=20)
c.rect(0.1, 0.1, 0.6, 0.6)
c.line(0.1, 0.1, 0.6, 0.6)
c.line(0.1, 0.6, 0.6, 0.1)
c.line(0.1, 0.6, 0.35, 0.8)
c.li... | true | true |
790847497be475df0c275744fe8ab1fd60ba1827 | 107 | py | Python | setup.py | NGoetz/NF | 935886db48f4675db1a2c42f7c264b12d5014ed8 | [
"MIT"
] | 1 | 2020-11-26T11:03:50.000Z | 2020-11-26T11:03:50.000Z | setup.py | NGoetz/NF | 935886db48f4675db1a2c42f7c264b12d5014ed8 | [
"MIT"
] | 1 | 2021-02-27T10:18:00.000Z | 2021-02-28T16:18:12.000Z | setup.py | NGoetz/NF | 935886db48f4675db1a2c42f7c264b12d5014ed8 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(name='nisrep', version='1.0', packages=find_packages())
| 26.75 | 61 | 0.775701 | from setuptools import setup, find_packages
setup(name='nisrep', version='1.0', packages=find_packages())
| true | true |
790848ea6d0eaac765686b016e7f84e414b14546 | 863 | py | Python | Difficulty/Medium/102.binary-tree-level-order-traversal.py | ryderfang/LeetCode | be9470dee6175bab321f0549f173c0c682dddd77 | [
"MIT"
] | null | null | null | Difficulty/Medium/102.binary-tree-level-order-traversal.py | ryderfang/LeetCode | be9470dee6175bab321f0549f173c0c682dddd77 | [
"MIT"
] | null | null | null | Difficulty/Medium/102.binary-tree-level-order-traversal.py | ryderfang/LeetCode | be9470dee6175bab321f0549f173c0c682dddd77 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=102 lang=python3
#
# [102] Binary Tree Level Order Traversal
#
# @lc code=start
# Definition for a binary tree node.
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
from typing import List, Optional... | 26.151515 | 70 | 0.543453 |
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
from typing import List, Optional
class Solution:
def levelOrder(self, root: Optional[TreeNode]) -> List[List[int]]:
ans = []
def _larger(n):
... | true | true |
79084a97db59f896cea5221ece7bd8b33762b60d | 905 | py | Python | ex001 a ex114/ex113.py | kesia-barros/exercicios-python | 12a019e61c4b29fa29803f394b15d0af304c2ff0 | [
"MIT"
] | null | null | null | ex001 a ex114/ex113.py | kesia-barros/exercicios-python | 12a019e61c4b29fa29803f394b15d0af304c2ff0 | [
"MIT"
] | null | null | null | ex001 a ex114/ex113.py | kesia-barros/exercicios-python | 12a019e61c4b29fa29803f394b15d0af304c2ff0 | [
"MIT"
] | null | null | null | def leiaint(msg):
while True:
try:
n = int(input(msg))
except(ValueError, TypeError):
print("\033[31mERRO: Por favor, digite um numero inteiro valido.\033[m")
except KeyboardInterrupt:
print("\n\033[31mO usuario preferiu não digitar esse numero.")
... | 31.206897 | 84 | 0.583425 | def leiaint(msg):
while True:
try:
n = int(input(msg))
except(ValueError, TypeError):
print("\033[31mERRO: Por favor, digite um numero inteiro valido.\033[m")
except KeyboardInterrupt:
print("\n\033[31mO usuario preferiu não digitar esse numero.")
... | true | true |
79084c12025bee298f9b7e86bb2f2006083722b9 | 669 | py | Python | app/core/management/commands/wait_for_db.py | nagarjunand/receipe-app-api | 705ed99979356644dddf999370e6b618404cef3e | [
"MIT"
] | null | null | null | app/core/management/commands/wait_for_db.py | nagarjunand/receipe-app-api | 705ed99979356644dddf999370e6b618404cef3e | [
"MIT"
] | null | null | null | app/core/management/commands/wait_for_db.py | nagarjunand/receipe-app-api | 705ed99979356644dddf999370e6b618404cef3e | [
"MIT"
] | null | null | null | import time
from django.db import connections
from django.db.utils import OperationalError
from django.core.management.base import BaseCommand
class Command(BaseCommand):
"""Django command to pause execution until database is available """
def handle(self, *args, **options):
self.stdout.write('Waitin... | 35.210526 | 78 | 0.654709 | import time
from django.db import connections
from django.db.utils import OperationalError
from django.core.management.base import BaseCommand
class Command(BaseCommand):
def handle(self, *args, **options):
self.stdout.write('Waiting for database...')
db_conn = None
while not db_conn:
... | true | true |
79084c67b911633cc1eddb635eec3def07253b4b | 1,742 | py | Python | crawler/lib/RobotsParser.py | wilsonsk/Node-React-Python-D3-Crawler-App | 5f988148e601f20d5ea86b0734d46eb1b5694fb7 | [
"MIT"
] | null | null | null | crawler/lib/RobotsParser.py | wilsonsk/Node-React-Python-D3-Crawler-App | 5f988148e601f20d5ea86b0734d46eb1b5694fb7 | [
"MIT"
] | null | null | null | crawler/lib/RobotsParser.py | wilsonsk/Node-React-Python-D3-Crawler-App | 5f988148e601f20d5ea86b0734d46eb1b5694fb7 | [
"MIT"
] | null | null | null | """
Filename: RobotsParser.py
Author: Maxwell Goldberg
Last modified: 06.09.17
Description: Helper class for parsing individual robots.txt records.
"""
# CONSTANTS
from constants import RECORD_MAX_LEN
# PYTHON BUILTINS
import re, unicodedata, logging
def test_ctrl_chars(s):
return len(s) != len("".join(ch for ch in ... | 30.034483 | 82 | 0.721584 |
from constants import RECORD_MAX_LEN
import re, unicodedata, logging
def test_ctrl_chars(s):
return len(s) != len("".join(ch for ch in s if unicodedata.category(ch)[0]!="C"))
class RobotsParser:
valid_fields = [u'user-agent', u'allow', u'disallow']
def __init__(self, record=None):
if record is None:
raise... | true | true |
79084c8d562303d6f89ec7cf7a4b26f457699d5d | 118 | py | Python | boa3_test/test_sc/exception_test/RaiseVariableException.py | hal0x2328/neo3-boa | 6825a3533384cb01660773050719402a9703065b | [
"Apache-2.0"
] | 25 | 2020-07-22T19:37:43.000Z | 2022-03-08T03:23:55.000Z | boa3_test/test_sc/exception_test/RaiseVariableException.py | hal0x2328/neo3-boa | 6825a3533384cb01660773050719402a9703065b | [
"Apache-2.0"
] | 419 | 2020-04-23T17:48:14.000Z | 2022-03-31T13:17:45.000Z | boa3_test/test_sc/exception_test/RaiseVariableException.py | hal0x2328/neo3-boa | 6825a3533384cb01660773050719402a9703065b | [
"Apache-2.0"
] | 15 | 2020-05-21T21:54:24.000Z | 2021-11-18T06:17:24.000Z | from boa3.builtin import public
@public
def test_raise(arg: int):
x = Exception
if arg < 0:
raise x
| 13.111111 | 31 | 0.627119 | from boa3.builtin import public
@public
def test_raise(arg: int):
x = Exception
if arg < 0:
raise x
| true | true |
79084ccc3679e782cdaddcbe8b3ea07ee03077ff | 1,296 | py | Python | torchio/transforms/interpolation.py | jwitos/torchio | 4d5c4fd75e1169f33f566c86e0bd25056dd5be0d | [
"Apache-2.0"
] | null | null | null | torchio/transforms/interpolation.py | jwitos/torchio | 4d5c4fd75e1169f33f566c86e0bd25056dd5be0d | [
"Apache-2.0"
] | null | null | null | torchio/transforms/interpolation.py | jwitos/torchio | 4d5c4fd75e1169f33f566c86e0bd25056dd5be0d | [
"Apache-2.0"
] | null | null | null | import enum
import SimpleITK as sitk
@enum.unique
class Interpolation(enum.Enum):
"""Interpolation techniques available in ITK.
Example:
>>> import torchio as tio
>>> transform = tio.RandomAffine(image_interpolation='nearest')
"""
#: Interpolates image intensity at a non-integer pixel... | 32.4 | 118 | 0.703704 | import enum
import SimpleITK as sitk
@enum.unique
class Interpolation(enum.Enum):
NEAREST: str = 'sitkNearestNeighbor'
LINEAR: str = 'sitkLinear'
BSPLINE: str = 'sitkBSpline'
GAUSSIAN: str = 'sitkGaussian'
LABEL_GAUSSIAN: str = 'sitkLabelGaussian'
HAMMING: str = 'sitkHamming... | true | true |
79084e06eb7c41d7efaca16a12e16305e91d17b5 | 95,422 | py | Python | mmtbx/twinning/twin_f_model.py | jbeilstenedmands/cctbx_project | c228fb15ab10377f664c39553d866281358195aa | [
"BSD-3-Clause-LBNL"
] | null | null | null | mmtbx/twinning/twin_f_model.py | jbeilstenedmands/cctbx_project | c228fb15ab10377f664c39553d866281358195aa | [
"BSD-3-Clause-LBNL"
] | null | null | null | mmtbx/twinning/twin_f_model.py | jbeilstenedmands/cctbx_project | c228fb15ab10377f664c39553d866281358195aa | [
"BSD-3-Clause-LBNL"
] | null | null | null | from __future__ import division
from cctbx import miller
from cctbx import crystal
from cctbx import sgtbx
from cctbx import xray
from cctbx import adptbx
from copy import deepcopy
from mmtbx import masks
import cctbx.xray.structure_factors
from cctbx.eltbx.xray_scattering import wk1995
from libtbx import adopt_init_ar... | 38.092615 | 175 | 0.599013 | from __future__ import division
from cctbx import miller
from cctbx import crystal
from cctbx import sgtbx
from cctbx import xray
from cctbx import adptbx
from copy import deepcopy
from mmtbx import masks
import cctbx.xray.structure_factors
from cctbx.eltbx.xray_scattering import wk1995
from libtbx import adopt_init_ar... | true | true |
79084e399ac257749fd04e3da4f96fea526c430d | 4,802 | py | Python | src/sentry/utils/distutils/commands/build_assets.py | learninto/sentry | 4f9f564841498b3af49c1677d6b61f3e47b01923 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/utils/distutils/commands/build_assets.py | learninto/sentry | 4f9f564841498b3af49c1677d6b61f3e47b01923 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/utils/distutils/commands/build_assets.py | learninto/sentry | 4f9f564841498b3af49c1677d6b61f3e47b01923 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
import json
import datetime
import os
import os.path
import sys
import traceback
from distutils import log
from .base import BaseBuildCommand
class BuildAssetsCommand(BaseBuildCommand):
user_options = BaseBuildCommand.user_options + [
(
"asset-json-pat... | 32.445946 | 96 | 0.591628 | from __future__ import absolute_import
import json
import datetime
import os
import os.path
import sys
import traceback
from distutils import log
from .base import BaseBuildCommand
class BuildAssetsCommand(BaseBuildCommand):
user_options = BaseBuildCommand.user_options + [
(
"asset-json-pat... | true | true |
79084f131a2a1af3dcb9660c0d56edb7174ed380 | 910 | py | Python | app/http/controllers/QuoteController.py | code-weather/capstone_backend_tailwindCSS | 57c02c5301c14a5b18fbf062bba6934386df32af | [
"MIT"
] | null | null | null | app/http/controllers/QuoteController.py | code-weather/capstone_backend_tailwindCSS | 57c02c5301c14a5b18fbf062bba6934386df32af | [
"MIT"
] | null | null | null | app/http/controllers/QuoteController.py | code-weather/capstone_backend_tailwindCSS | 57c02c5301c14a5b18fbf062bba6934386df32af | [
"MIT"
] | null | null | null | """ A QuoteController Module """
from masonite.controllers import Controller
from masonite.request import Request
from app.Quote import Quote
class QuoteController(Controller):
def __init__(self, request: Request):
self.request = request
def show(self):
id = self.request.param("id")
r... | 26.764706 | 58 | 0.613187 |
from masonite.controllers import Controller
from masonite.request import Request
from app.Quote import Quote
class QuoteController(Controller):
def __init__(self, request: Request):
self.request = request
def show(self):
id = self.request.param("id")
return Quote.find(id)
def ind... | true | true |
7908504b14297053b56a66d358d5e0e8e487d6ba | 1,886 | py | Python | sky/engine/build/scripts/make_element_factory.py | gitFreeByte/sky_engine | 05c9048930f8a0d39c2f6385ba691eccbbdabb20 | [
"BSD-3-Clause"
] | 1 | 2021-06-12T00:47:11.000Z | 2021-06-12T00:47:11.000Z | sky/engine/build/scripts/make_element_factory.py | gitFreeByte/sky_engine | 05c9048930f8a0d39c2f6385ba691eccbbdabb20 | [
"BSD-3-Clause"
] | null | null | null | sky/engine/build/scripts/make_element_factory.py | gitFreeByte/sky_engine | 05c9048930f8a0d39c2f6385ba691eccbbdabb20 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright (C) 2013 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list ... | 42.863636 | 72 | 0.792683 |
import sys
from collections import defaultdict
import in_generator
import template_expander
import name_utilities
from make_qualified_names import MakeQualifiedNamesWriter
class MakeElementFactoryWriter(MakeQualifiedNamesWriter):
pass
if __name__ == "__main__":
in_generator.Make... | true | true |
790850e2acd33fd1d6014089093e4ebb5705db43 | 2,543 | py | Python | test/functional/wallet_startup.py | ludirium/ludirium | d2c6d7855ed98c62b6c9431e695d9b1a791255a6 | [
"MIT"
] | null | null | null | test/functional/wallet_startup.py | ludirium/ludirium | d2c6d7855ed98c62b6c9431e695d9b1a791255a6 | [
"MIT"
] | null | null | null | test/functional/wallet_startup.py | ludirium/ludirium | d2c6d7855ed98c62b6c9431e695d9b1a791255a6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017-2020 The Ludirium Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test wallet load on startup.
Verify that a ludiriumd node can maintain list of wallets loading on sta... | 43.101695 | 98 | 0.69013 |
from test_framework.test_framework import LudiriumTestFramework
from test_framework.util import (
assert_equal,
)
class WalletStartupTest(LudiriumTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 1
self.supports_cli = True
def skip_test_... | true | true |
79085161c84a2e62516e76faf0cf380d40a1d3b6 | 256 | py | Python | claims/admin.py | joinrpg/joinrpg | 90d00edcdc7035d31c9ffc7598158bac61e65dbd | [
"Apache-2.0"
] | 2 | 2016-11-02T11:15:42.000Z | 2017-10-03T08:28:18.000Z | claims/admin.py | joinrpg/joinrpg-unused | 90d00edcdc7035d31c9ffc7598158bac61e65dbd | [
"Apache-2.0"
] | 33 | 2016-03-22T16:11:37.000Z | 2016-03-22T16:12:17.000Z | claims/admin.py | joinrpg/joinrpg | 90d00edcdc7035d31c9ffc7598158bac61e65dbd | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from claims import models
# Register your models here.
admin.site.register(models.AddressCountry)
admin.site.register(models.AddressRegion)
admin.site.register(models.AddressCity)
admin.site.register(models.ProjectStatus)
| 28.444444 | 42 | 0.839844 | from django.contrib import admin
from claims import models
admin.site.register(models.AddressCountry)
admin.site.register(models.AddressRegion)
admin.site.register(models.AddressCity)
admin.site.register(models.ProjectStatus)
| true | true |
790852d587fd06e0938160c8b2f6cd3d9398de78 | 576 | py | Python | scripts/secex_monthly/_pci_wld_eci.py | DataViva/dataviva-scripts | 1e36f11e2849c33b8118cefe1755d312b19c0ecd | [
"MIT"
] | 10 | 2015-05-20T14:41:23.000Z | 2020-05-27T22:36:19.000Z | scripts/secex_monthly/_pci_wld_eci.py | DataViva/dataviva-scripts | 1e36f11e2849c33b8118cefe1755d312b19c0ecd | [
"MIT"
] | 11 | 2018-05-17T14:30:58.000Z | 2018-09-06T21:20:34.000Z | scripts/secex_monthly/_pci_wld_eci.py | DataViva/dataviva-scripts | 1e36f11e2849c33b8118cefe1755d312b19c0ecd | [
"MIT"
] | 12 | 2015-07-14T13:46:41.000Z | 2019-09-20T00:47:10.000Z | import sys
import pandas as pd
def pci_wld_eci(eci_file_path, pci_file_path, ymp, ymw, year):
pcis = pd.read_csv(pci_file_path, sep="\t", compression="bz2", converters={"hs_id": str})
pcis["year"] = int(year)
pcis["month"] = "00"
pcis = pcis.set_index(["year", "month", "hs_id"])
ecis = pd.... | 28.8 | 93 | 0.583333 | import sys
import pandas as pd
def pci_wld_eci(eci_file_path, pci_file_path, ymp, ymw, year):
pcis = pd.read_csv(pci_file_path, sep="\t", compression="bz2", converters={"hs_id": str})
pcis["year"] = int(year)
pcis["month"] = "00"
pcis = pcis.set_index(["year", "month", "hs_id"])
ecis = pd.... | true | true |
7908534f4477b84eacc349451f3f5f5efa3271cb | 2,603 | py | Python | django_splitdate/tests/runtests.py | Mactory/django-splitdate | 58a48f048a5deeb2fd7b46f9c403bb6c2f34309a | [
"MIT"
] | 2 | 2015-02-19T16:26:05.000Z | 2016-07-18T23:20:35.000Z | django_splitdate/tests/runtests.py | Mactory/django-splitdate | 58a48f048a5deeb2fd7b46f9c403bb6c2f34309a | [
"MIT"
] | 1 | 2018-03-04T20:56:56.000Z | 2018-03-04T20:56:56.000Z | django_splitdate/tests/runtests.py | Mactory/django-splitdate | 58a48f048a5deeb2fd7b46f9c403bb6c2f34309a | [
"MIT"
] | 1 | 2018-03-04T20:54:39.000Z | 2018-03-04T20:54:39.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
__author__ = 'Tim Schneider <tim.schneider@northbridge-development.de>'
__copyright__ = "Copyright 2015, Northbridge Development Konrad & Schneider GbR"
__credits__ = ["Tim Schneider", ]
__maintainer__ = "Tim Schneider"
__email__ = "mail@northbridge-developm... | 25.271845 | 100 | 0.688436 |
import logging
__author__ = 'Tim Schneider <tim.schneider@northbridge-development.de>'
__copyright__ = "Copyright 2015, Northbridge Development Konrad & Schneider GbR"
__credits__ = ["Tim Schneider", ]
__maintainer__ = "Tim Schneider"
__email__ = "mail@northbridge-development.de"
__status__ = "Development"
logger =... | false | true |
79085417c55bd1998bdacaf37aa3f5a99211e440 | 4,902 | py | Python | site-packages/celery/tests/utils/test_functional.py | suntao789/Aclsm | 2202201c8279391386a4569e69f93d90eca5b96a | [
"Apache-2.0"
] | null | null | null | site-packages/celery/tests/utils/test_functional.py | suntao789/Aclsm | 2202201c8279391386a4569e69f93d90eca5b96a | [
"Apache-2.0"
] | null | null | null | site-packages/celery/tests/utils/test_functional.py | suntao789/Aclsm | 2202201c8279391386a4569e69f93d90eca5b96a | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
import pickle
from kombu.utils.functional import lazy
from celery.five import THREAD_TIMEOUT_MAX, items, range, nextfun
from celery.utils.functional import (
LRUCache,
firstmethod,
first,
mlazy,
padlist,
maybe_list,
)
from celery.tests.case import Case
... | 27.082873 | 71 | 0.5459 | from __future__ import absolute_import
import pickle
from kombu.utils.functional import lazy
from celery.five import THREAD_TIMEOUT_MAX, items, range, nextfun
from celery.utils.functional import (
LRUCache,
firstmethod,
first,
mlazy,
padlist,
maybe_list,
)
from celery.tests.case import Case
... | true | true |
7908546a82ed99e9708152d48a1748c8b6c982c4 | 232 | py | Python | Aula 1/aula2.py | Carlosouzavalle/Python | 10bfedb99fec39f679d55e6729751595b6712627 | [
"MIT"
] | null | null | null | Aula 1/aula2.py | Carlosouzavalle/Python | 10bfedb99fec39f679d55e6729751595b6712627 | [
"MIT"
] | null | null | null | Aula 1/aula2.py | Carlosouzavalle/Python | 10bfedb99fec39f679d55e6729751595b6712627 | [
"MIT"
] | null | null | null | #corresponde ao video 6 do curso
# Primeiros passos
n = input('Digite algo: ')
print(n.isnumeric()) # se é numerico
print(n.isalpha()) # se é letra
print(n.isalnum()) # se é alpha numerico
print(n.isupper()) # ta em letra maiuscula | 29 | 42 | 0.706897 |
n = input('Digite algo: ')
print(n.isnumeric())
print(n.isalpha())
print(n.isalnum())
print(n.isupper()) | true | true |
7908547a3f81245633ce604c81999a78a9c5f532 | 1,970 | py | Python | tests/bundles/sqlalchemy/services/test_session_manager.py | achiang/flask-unchained | 12788a6e618904a25ff2b571eb05ff1dc8f1840f | [
"MIT"
] | 69 | 2018-10-10T01:59:11.000Z | 2022-03-29T17:29:30.000Z | tests/bundles/sqlalchemy/services/test_session_manager.py | achiang/flask-unchained | 12788a6e618904a25ff2b571eb05ff1dc8f1840f | [
"MIT"
] | 18 | 2018-11-17T12:42:02.000Z | 2021-05-22T18:45:27.000Z | tests/bundles/sqlalchemy/services/test_session_manager.py | achiang/flask-unchained | 12788a6e618904a25ff2b571eb05ff1dc8f1840f | [
"MIT"
] | 7 | 2018-10-12T16:20:25.000Z | 2021-10-06T12:18:21.000Z | from flask_unchained.bundles.sqlalchemy import SessionManager, SQLAlchemyUnchained
def setup(db: SQLAlchemyUnchained):
session_manager = SessionManager(db)
class Foo(db.Model):
class Meta:
lazy_mapped = False
name = db.Column(db.String)
db.create_all()
return Foo, sessio... | 28.970588 | 82 | 0.613198 | from flask_unchained.bundles.sqlalchemy import SessionManager, SQLAlchemyUnchained
def setup(db: SQLAlchemyUnchained):
session_manager = SessionManager(db)
class Foo(db.Model):
class Meta:
lazy_mapped = False
name = db.Column(db.String)
db.create_all()
return Foo, sessio... | true | true |
79085487abf137bfca6657ae5c230f19f6f1a642 | 3,605 | py | Python | steam-scrapy/steam_scrape/middlewares.py | argwood/IndieP | 938e50ae6c928d9b25732afb7dbfd6e2cd8f85d2 | [
"MIT"
] | null | null | null | steam-scrapy/steam_scrape/middlewares.py | argwood/IndieP | 938e50ae6c928d9b25732afb7dbfd6e2cd8f85d2 | [
"MIT"
] | null | null | null | steam-scrapy/steam_scrape/middlewares.py | argwood/IndieP | 938e50ae6c928d9b25732afb7dbfd6e2cd8f85d2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
class SteamScrapeSpiderMiddleware(object):
# Not all methods need to be defined. If a method is not defined,
# sc... | 34.663462 | 78 | 0.666852 |
from scrapy import signals
class SteamScrapeSpiderMiddleware(object):
@classmethod
def from_crawler(cls, crawler):
s = cls()
crawler.signals.connect(s.spider_opened, signal=signals.spider_opened)
return s
def process_spider_input(self, response, spi... | true | true |
79085655a2b2255e6cc4ae45576545c97d3ac894 | 144,292 | py | Python | Chuckysb.py | sahrukanja/fryant1 | 8bd2ed4b3d3bda930d063a16ad9600bcb8348d68 | [
"MIT"
] | null | null | null | Chuckysb.py | sahrukanja/fryant1 | 8bd2ed4b3d3bda930d063a16ad9600bcb8348d68 | [
"MIT"
] | null | null | null | Chuckysb.py | sahrukanja/fryant1 | 8bd2ed4b3d3bda930d063a16ad9600bcb8348d68 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#Chucky_Bot
import LINETCR
from LINETCR.lib.curve.ttypes import *
from datetime import datetime
from bs4 import BeautifulSoup
from threading import Thread
from googletrans import Translator
from gtts import gTTS
import time,random,sys,json,codecs,threading,glob,urllib,urllib2,urllib3,re,ast,os,... | 41.510932 | 453 | 0.419462 |
import LINETCR
from LINETCR.lib.curve.ttypes import *
from datetime import datetime
from bs4 import BeautifulSoup
from threading import Thread
from googletrans import Translator
from gtts import gTTS
import time,random,sys,json,codecs,threading,glob,urllib,urllib2,urllib3,re,ast,os,subprocess,requests,tempfile
nady... | false | true |
7908573ec9d313bf3168d98f4cf7ead29d9e6104 | 1,590 | py | Python | tests/test_job_slurm.py | boazbk/mle-scheduler | 4cf83873d9beb75b19b2deb9baf4394931b9624d | [
"MIT"
] | 26 | 2021-11-12T15:06:54.000Z | 2022-03-29T20:42:17.000Z | tests/test_job_slurm.py | boazbk/mle-scheduler | 4cf83873d9beb75b19b2deb9baf4394931b9624d | [
"MIT"
] | 4 | 2021-12-12T20:37:40.000Z | 2022-03-01T10:18:14.000Z | tests/test_job_slurm.py | boazbk/mle-scheduler | 4cf83873d9beb75b19b2deb9baf4394931b9624d | [
"MIT"
] | 1 | 2021-12-13T17:24:02.000Z | 2021-12-13T17:24:02.000Z | from mle_scheduler.cluster.slurm.helpers_launch_slurm import slurm_generate_startup_file
job_arguments = {
"num_logical_cores": 5,
"partition": "standard",
"job_name": "test_job",
"num_gpus": 1,
"gpu_type": "RTX2080",
"env_name": "test_env",
"use_conda_venv": True,
"script": "python run... | 32.44898 | 88 | 0.510063 | from mle_scheduler.cluster.slurm.helpers_launch_slurm import slurm_generate_startup_file
job_arguments = {
"num_logical_cores": 5,
"partition": "standard",
"job_name": "test_job",
"num_gpus": 1,
"gpu_type": "RTX2080",
"env_name": "test_env",
"use_conda_venv": True,
"script": "python run... | true | true |
7908577f8c2a2ab188604d2f337300b351bf96eb | 6,189 | py | Python | venv/lib/python3.6/site-packages/maxminddb/decoder.py | jyoost/saleordjangooriginal | e7d0da1f6f653607580a9cd792acfc4917908649 | [
"CC-BY-4.0"
] | 2 | 2019-12-06T15:40:14.000Z | 2020-07-29T21:30:35.000Z | venv/lib/python3.6/site-packages/maxminddb/decoder.py | jyoost/saleor | e7d0da1f6f653607580a9cd792acfc4917908649 | [
"CC-BY-4.0"
] | 13 | 2020-03-24T17:53:51.000Z | 2022-02-10T20:01:14.000Z | venv/lib/python3.6/site-packages/maxminddb/decoder.py | jyoost/saleor | e7d0da1f6f653607580a9cd792acfc4917908649 | [
"CC-BY-4.0"
] | null | null | null | """
maxminddb.decoder
~~~~~~~~~~~~~~~~~
This package contains code for decoding the MaxMind DB data section.
"""
from __future__ import unicode_literals
import struct
from maxminddb.compat import byte_from_int, int_from_bytes
from maxminddb.errors import InvalidDatabaseError
class Decoder(object): # pylint: disa... | 35.568966 | 78 | 0.598158 | from __future__ import unicode_literals
import struct
from maxminddb.compat import byte_from_int, int_from_bytes
from maxminddb.errors import InvalidDatabaseError
class Decoder(object):
def __init__(self, database_buffer, pointer_base=0, pointer_test=False):
self._pointer_test = pointer_test
s... | true | true |
7908595b5f84d4426174500ff5e23a1ae3aa1b6a | 1,787 | py | Python | src/evrythng/entities/action_types.py | jwpthng/evrythng-python-sdk | 42d6ea540c1511a7a75a835fe59d9d47a252a534 | [
"MIT"
] | null | null | null | src/evrythng/entities/action_types.py | jwpthng/evrythng-python-sdk | 42d6ea540c1511a7a75a835fe59d9d47a252a534 | [
"MIT"
] | null | null | null | src/evrythng/entities/action_types.py | jwpthng/evrythng-python-sdk | 42d6ea540c1511a7a75a835fe59d9d47a252a534 | [
"MIT"
] | null | null | null | """
Evrything Docs
https://dashboard.evrythng.com/documentation/api/actiontypes
"""
from evrythng import assertions, utils
field_specs = {
'datatypes': {
'name': 'str',
'customFields': 'dict',
'tags': 'dict_of_str',
'scopes': 'dict',
},
'required': ('name',),
'readonly'... | 32.490909 | 82 | 0.632904 | from evrythng import assertions, utils
field_specs = {
'datatypes': {
'name': 'str',
'customFields': 'dict',
'tags': 'dict_of_str',
'scopes': 'dict',
},
'required': ('name',),
'readonly': ('id', 'createdAt', 'updatedAt'),
'writable': ('customFields', 'tags', 'scopes... | true | true |
790859aab3f4aac6392a67ec8ce2261a7d4d198d | 303 | py | Python | derbot/names/apps.py | bdunnette/derbot-docker | b28fd0bf7f078dac1f72024dbd13c233d657c043 | [
"MIT"
] | null | null | null | derbot/names/apps.py | bdunnette/derbot-docker | b28fd0bf7f078dac1f72024dbd13c233d657c043 | [
"MIT"
] | 11 | 2022-02-21T05:29:51.000Z | 2022-03-31T05:33:10.000Z | derbot/names/apps.py | bdunnette/derbot-docker | b28fd0bf7f078dac1f72024dbd13c233d657c043 | [
"MIT"
] | null | null | null | from asyncio.log import logger
from django.apps import AppConfig
class NamesConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "derbot.names"
def ready(self):
import derbot.names.signals
logger.info(f"Signals loaded: {derbot.names.signals}")
| 21.642857 | 62 | 0.716172 | from asyncio.log import logger
from django.apps import AppConfig
class NamesConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "derbot.names"
def ready(self):
import derbot.names.signals
logger.info(f"Signals loaded: {derbot.names.signals}")
| true | true |
790859b59c2b3dbfc8d52a5272d6eed638a2822b | 2,815 | py | Python | components/collector/src/collectors/azure_devops.py | Hedde/quality-time | bfbdb2c43d7883abaf54999411aa4ac4897e9043 | [
"Apache-2.0"
] | null | null | null | components/collector/src/collectors/azure_devops.py | Hedde/quality-time | bfbdb2c43d7883abaf54999411aa4ac4897e9043 | [
"Apache-2.0"
] | null | null | null | components/collector/src/collectors/azure_devops.py | Hedde/quality-time | bfbdb2c43d7883abaf54999411aa4ac4897e9043 | [
"Apache-2.0"
] | null | null | null | """Azure Devops Server metric collector."""
from typing import List
import requests
from ..collector import Collector
from ..type import Entities, URL, Value
class AzureDevopsBase(Collector):
"""Base class for Azure DevOps collectors."""
def api_url(self) -> URL:
url = super().api_url()
re... | 45.403226 | 117 | 0.662522 |
from typing import List
import requests
from ..collector import Collector
from ..type import Entities, URL, Value
class AzureDevopsBase(Collector):
def api_url(self) -> URL:
url = super().api_url()
return URL(f"{url}/_apis/wit/wiql?api-version=4.1")
def get_source_responses(self, api_url:... | true | true |
79085a6c06f94f9781c1a341cbcc3d429b30a260 | 17,381 | py | Python | docs/examples/Moving_Platform_Simulation.py | Red-Portal/Stone-Soup-1 | 267621c86161a839da9b144c2745d28d9166d903 | [
"MIT"
] | 157 | 2019-04-14T20:43:11.000Z | 2022-03-30T08:30:33.000Z | docs/examples/Moving_Platform_Simulation.py | Red-Portal/Stone-Soup-1 | 267621c86161a839da9b144c2745d28d9166d903 | [
"MIT"
] | 364 | 2019-04-18T15:54:49.000Z | 2022-03-31T09:50:02.000Z | docs/examples/Moving_Platform_Simulation.py | Red-Portal/Stone-Soup-1 | 267621c86161a839da9b144c2745d28d9166d903 | [
"MIT"
] | 86 | 2019-04-20T02:01:18.000Z | 2022-03-28T01:03:11.000Z | #!/usr/bin/env python
# coding: utf-8
"""
Multi-Sensor Moving Platform Simulation Example
===============================================
This example looks at how multiple sensors can be mounted on a single moving platform and exploiting a defined moving
platform as a sensor target.
"""
# %%
# Building a Simulated M... | 44.452685 | 120 | 0.693976 |
from datetime import datetime
from datetime import timedelta
from matplotlib import pyplot as plt
import numpy as np
from stonesoup.types.state import State, GaussianState
from stonesoup.types.array import StateVector
from stonesoup.types.array import CovarianceMatrix
from stonesoup.models.transit... | true | true |
79085aa28cf71f40671b37a9542ed50040078c69 | 7,070 | py | Python | lib/model/rpn/proposal_layer.py | jinyu121/CIOD | 37ab2ce14635c4b5cef2ea43b8439c5cd0e0f662 | [
"MIT"
] | 33 | 2019-07-09T07:14:40.000Z | 2022-02-17T03:00:36.000Z | lib/model/rpn/proposal_layer.py | busyboxs/pytorch-faster-rcnn | 97cea8fce0de3d1d552de1ad9b941e85f2920efa | [
"MIT"
] | 7 | 2020-01-10T16:37:12.000Z | 2021-11-26T02:02:13.000Z | lib/model/rpn/proposal_layer.py | busyboxs/pytorch-faster-rcnn | 97cea8fce0de3d1d552de1ad9b941e85f2920efa | [
"MIT"
] | 7 | 2019-07-18T02:27:44.000Z | 2020-04-28T09:41:27.000Z | from __future__ import absolute_import
# --------------------------------------------------------
# Faster R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick and Sean Bell
# --------------------------------------------------------
# ---------------... | 39.943503 | 120 | 0.603112 | from __future__ import absolute_import
import torch
import torch.nn as nn
import numpy as np
import math
import yaml
from model.utils.config import cfg
from .generate_anchors import generate_anchors
from .bbox_transform import bbox_transform_inv, clip_boxes, clip_boxes_batch
from model.nms.nms_wrapper import ... | true | true |
79085b5df8fb20ad6f1d7eee0d3aab21a34df364 | 87,196 | py | Python | src/sage/matrix/matrix_space.py | kliem/sage-test-27122 | cc60cfebc4576fed8b01f0fc487271bdee3cefed | [
"BSL-1.0"
] | null | null | null | src/sage/matrix/matrix_space.py | kliem/sage-test-27122 | cc60cfebc4576fed8b01f0fc487271bdee3cefed | [
"BSL-1.0"
] | 2 | 2021-04-02T20:43:29.000Z | 2021-04-05T23:38:58.000Z | src/sage/matrix/matrix_space.py | kliem/sage-test-27122 | cc60cfebc4576fed8b01f0fc487271bdee3cefed | [
"BSL-1.0"
] | 1 | 2020-07-23T10:29:56.000Z | 2020-07-23T10:29:56.000Z | r"""
Matrix Spaces
You can create any space `\text{Mat}_{n\times m}(R)` of
either dense or sparse matrices with given number of rows and
columns over any commutative or noncommutative ring.
EXAMPLES::
sage: MS = MatrixSpace(QQ,6,6,sparse=True); MS
Full MatrixSpace of 6 by 6 sparse matrices over Rational Fiel... | 34.396844 | 175 | 0.549658 |
import sys
import operator
from . import matrix_generic_dense
from . import matrix_generic_sparse
import sage.structure.coerce
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
import sage.rings.integer as integer
import sage.rings.finite_rings.... | true | true |
79085bf646a15f04d6ff2922d7764eaa4cfb6e13 | 145 | py | Python | Conversor_metros.py | KazumaShachou/Programs-in-Python | 307f59e2a53b3a07eaf2ddf199bbffa0cf8d394f | [
"MIT"
] | null | null | null | Conversor_metros.py | KazumaShachou/Programs-in-Python | 307f59e2a53b3a07eaf2ddf199bbffa0cf8d394f | [
"MIT"
] | null | null | null | Conversor_metros.py | KazumaShachou/Programs-in-Python | 307f59e2a53b3a07eaf2ddf199bbffa0cf8d394f | [
"MIT"
] | null | null | null | n = int(input('digite um numero para metros'))
print('o valor {} metros, vale {} em centimetros, e vale {} milimetros'.format(n, n*100, n*1000))
| 48.333333 | 97 | 0.675862 | n = int(input('digite um numero para metros'))
print('o valor {} metros, vale {} em centimetros, e vale {} milimetros'.format(n, n*100, n*1000))
| true | true |
79085dd250c1e2298a23c9208789dd8fb87a1771 | 1,754 | py | Python | pyngboard/credentials.py | tsouza/pyngboard | 00f696453c0dddedad588b2f48259e0c158a88ec | [
"MIT"
] | 1 | 2017-03-30T16:34:36.000Z | 2017-03-30T16:34:36.000Z | pyngboard/credentials.py | tsouza/pyngboard | 00f696453c0dddedad588b2f48259e0c158a88ec | [
"MIT"
] | null | null | null | pyngboard/credentials.py | tsouza/pyngboard | 00f696453c0dddedad588b2f48259e0c158a88ec | [
"MIT"
] | 1 | 2016-08-31T10:31:28.000Z | 2016-08-31T10:31:28.000Z | import os
class FileCredentials:
def __init__(self, credentials_file):
if credentials_file == None:
credentials_file = os.path.expanduser("~") + "/.pingboard"
self.credentials_file = credentials_file
self.client_id = None
self.client_secret = None
def load(self):
... | 27.40625 | 95 | 0.600342 | import os
class FileCredentials:
def __init__(self, credentials_file):
if credentials_file == None:
credentials_file = os.path.expanduser("~") + "/.pingboard"
self.credentials_file = credentials_file
self.client_id = None
self.client_secret = None
def load(self):
... | true | true |
79085ee902a617ecb3b1ec8e2483f280bc007e90 | 458 | py | Python | galerias/urls.py | shiminasai/interteam-1 | 1be77a529025a226fb759fb3e04811d854f90f66 | [
"MIT"
] | null | null | null | galerias/urls.py | shiminasai/interteam-1 | 1be77a529025a226fb759fb3e04811d854f90f66 | [
"MIT"
] | null | null | null | galerias/urls.py | shiminasai/interteam-1 | 1be77a529025a226fb759fb3e04811d854f90f66 | [
"MIT"
] | 3 | 2018-06-07T15:36:04.000Z | 2019-04-01T19:25:43.000Z | from django.urls import include, path, re_path
from .models import *
from .views import *
urlpatterns = [
path('imagenes/', lista_galerias_img, name='lista-galerias-img'),
path('imagenes/<tema>', filtro_temas_img, name='filtro_temas_img'),
path('imagenes/<id>/', detalle_galerias_img, name='detalle-galerias-img'),
... | 41.636364 | 75 | 0.746725 | from django.urls import include, path, re_path
from .models import *
from .views import *
urlpatterns = [
path('imagenes/', lista_galerias_img, name='lista-galerias-img'),
path('imagenes/<tema>', filtro_temas_img, name='filtro_temas_img'),
path('imagenes/<id>/', detalle_galerias_img, name='detalle-galerias-img'),
... | true | true |
79085fe85c4825d66a89abb24efaea57782be387 | 3,119 | py | Python | topsis.py | diptikaushal/TOPSIS-Dipti-101803601 | 0919e64072d4f301f311ddf280bc0c7b920ecbd5 | [
"MIT"
] | null | null | null | topsis.py | diptikaushal/TOPSIS-Dipti-101803601 | 0919e64072d4f301f311ddf280bc0c7b920ecbd5 | [
"MIT"
] | null | null | null | topsis.py | diptikaushal/TOPSIS-Dipti-101803601 | 0919e64072d4f301f311ddf280bc0c7b920ecbd5 | [
"MIT"
] | null | null | null | import pandas as pd
import sys
from os import path
import numpy
from sys import exit
def main():
if len(sys.argv)!=5:
print("Incorrect no. of parameters passed.")
exit(0)
i=sys.argv[1]
w=sys.argv[2]
im=sys.argv[3]
result=sys.argv[4]
if not i.endswith('.csv... | 30.281553 | 99 | 0.435075 | import pandas as pd
import sys
from os import path
import numpy
from sys import exit
def main():
if len(sys.argv)!=5:
print("Incorrect no. of parameters passed.")
exit(0)
i=sys.argv[1]
w=sys.argv[2]
im=sys.argv[3]
result=sys.argv[4]
if not i.endswith('.csv... | true | true |
79086034d91e7c6e4f944bc89dbc653fd5ab3a2a | 743 | py | Python | src/hark_lang/executors/thread.py | krrome/teal-lang | 594ac0f0baae047fdb19ac9126d174408d487905 | [
"Apache-2.0"
] | 85 | 2020-04-29T13:51:33.000Z | 2020-08-28T04:40:11.000Z | src/hark_lang/executors/thread.py | krrome/teal-lang | 594ac0f0baae047fdb19ac9126d174408d487905 | [
"Apache-2.0"
] | 15 | 2020-05-06T07:58:18.000Z | 2020-08-28T10:29:28.000Z | src/hark_lang/executors/thread.py | krrome/teal-lang | 594ac0f0baae047fdb19ac9126d174408d487905 | [
"Apache-2.0"
] | 4 | 2020-05-31T09:42:08.000Z | 2020-08-27T17:04:26.000Z | import logging
import threading
import time
import traceback
import warnings
from ..machine.machine import TlMachine
LOG = logging.getLogger(__name__)
class Invoker:
def __init__(self, data_controller):
self.data_controller = data_controller
self.exception = None
threading.excepthook = s... | 24.766667 | 62 | 0.650067 | import logging
import threading
import time
import traceback
import warnings
from ..machine.machine import TlMachine
LOG = logging.getLogger(__name__)
class Invoker:
def __init__(self, data_controller):
self.data_controller = data_controller
self.exception = None
threading.excepthook = s... | true | true |
7908603d96dc1027215771828eb3a38ef8ffd7d3 | 46,925 | py | Python | simpletransformers/seq2seq/seq2seq_model.py | mahanswaray/simpletransformers | 44a97d689b6bd19495e698ae918e67c80828559e | [
"Apache-2.0"
] | 2 | 2021-03-13T19:05:46.000Z | 2021-11-07T20:03:36.000Z | simpletransformers/seq2seq/seq2seq_model.py | mahanswaray/simpletransformers | 44a97d689b6bd19495e698ae918e67c80828559e | [
"Apache-2.0"
] | null | null | null | simpletransformers/seq2seq/seq2seq_model.py | mahanswaray/simpletransformers | 44a97d689b6bd19495e698ae918e67c80828559e | [
"Apache-2.0"
] | 3 | 2021-11-07T19:55:46.000Z | 2022-01-24T15:25:33.000Z | import json
import logging
import math
import os
import random
import warnings
from dataclasses import asdict
from multiprocessing import Pool, cpu_count
from pathlib import Path
import numpy as np
import pandas as pd
import torch
from tensorboardX import SummaryWriter
from torch.nn.utils.rnn import pad_sequence
from ... | 46.231527 | 227 | 0.58212 | import json
import logging
import math
import os
import random
import warnings
from dataclasses import asdict
from multiprocessing import Pool, cpu_count
from pathlib import Path
import numpy as np
import pandas as pd
import torch
from tensorboardX import SummaryWriter
from torch.nn.utils.rnn import pad_sequence
from ... | true | true |
790860829b3afe564d22a3be18d4eabe97541fa8 | 3,423 | py | Python | dataloaders/__init__.py | dzwallkilled/pytorch-deeplab-xception | d8c04a24641c8c31a6800a37de6a7bfe607e5495 | [
"MIT"
] | null | null | null | dataloaders/__init__.py | dzwallkilled/pytorch-deeplab-xception | d8c04a24641c8c31a6800a37de6a7bfe607e5495 | [
"MIT"
] | null | null | null | dataloaders/__init__.py | dzwallkilled/pytorch-deeplab-xception | d8c04a24641c8c31a6800a37de6a7bfe607e5495 | [
"MIT"
] | null | null | null | from dataloaders.datasets import cityscapes, coco, combine_dbs, pascal, sbd, rip
from torch.utils.data import DataLoader
def make_data_loader(args, **kwargs):
if args.dataset == 'pascal':
train_set = pascal.VOCSegmentation(args, split='train')
val_set = pascal.VOCSegmentation(args, split='val')
... | 48.211268 | 112 | 0.684487 | from dataloaders.datasets import cityscapes, coco, combine_dbs, pascal, sbd, rip
from torch.utils.data import DataLoader
def make_data_loader(args, **kwargs):
if args.dataset == 'pascal':
train_set = pascal.VOCSegmentation(args, split='train')
val_set = pascal.VOCSegmentation(args, split='val')
... | true | true |
79086156a6561eb37e79d532af049091f1d13751 | 3,025 | py | Python | mizarlabs/tests/transformers/test_rsi.py | MizarAI/mizar-labs | c6ec17bc3d9a91ec3f6ee2e7b20017499115fc37 | [
"MIT"
] | 18 | 2021-03-19T15:41:43.000Z | 2022-03-20T14:23:07.000Z | mizarlabs/tests/transformers/test_rsi.py | MizarAI/mizar-labs | c6ec17bc3d9a91ec3f6ee2e7b20017499115fc37 | [
"MIT"
] | 14 | 2021-03-17T14:16:02.000Z | 2021-05-31T16:51:12.000Z | mizarlabs/tests/transformers/test_rsi.py | MizarAI/mizar-labs | c6ec17bc3d9a91ec3f6ee2e7b20017499115fc37 | [
"MIT"
] | 3 | 2021-07-02T21:38:06.000Z | 2022-01-10T09:56:18.000Z | from mizarlabs.transformers.technical.rsi import BarArrivalRSIStrategy
from mizarlabs.transformers.technical.rsi import RSIConfirmation
def test_bar_arrival_rsi_strategy_predict(dollar_bar_dataframe):
rsi_upper_threshold = 55
rsi_lower_threshold = 45
bar_arrival_upper_threshold = 0
bar_arrival_lower_t... | 35.174419 | 83 | 0.753719 | from mizarlabs.transformers.technical.rsi import BarArrivalRSIStrategy
from mizarlabs.transformers.technical.rsi import RSIConfirmation
def test_bar_arrival_rsi_strategy_predict(dollar_bar_dataframe):
rsi_upper_threshold = 55
rsi_lower_threshold = 45
bar_arrival_upper_threshold = 0
bar_arrival_lower_t... | true | true |
790861f2a12db1fc516a552714bea108abca7751 | 3,681 | py | Python | HackPSUconfig.py | hackpsu-tech/hackPSUS2018-rfid | 0f33b588ddbf4a82ced9a25ba8a8384649b16017 | [
"MIT"
] | null | null | null | HackPSUconfig.py | hackpsu-tech/hackPSUS2018-rfid | 0f33b588ddbf4a82ced9a25ba8a8384649b16017 | [
"MIT"
] | 2 | 2018-04-02T14:32:13.000Z | 2018-08-20T22:54:15.000Z | HackPSUconfig.py | hackpsu-tech/hackPSUS2018-rfid | 0f33b588ddbf4a82ced9a25ba8a8384649b16017 | [
"MIT"
] | null | null | null | """
This module provides an interface for reading and writing to a HackPSU RaspberryPi Scanner config file
Methods:
getProperty(configFile, prop)
Get a property from a config file by reading the config file until the desired property is found
setProperty(configFile, prop, value)
Set a property by updating the co... | 27.676692 | 111 | 0.710676 |
def getProperties(configFile):
dict = {}
with open(configFile) as file:
for line in file:
line = line.strip()
if line.startswith('#'):
continue
loc = line.find('=')
if loc == -1:
continue
key = line[:loc]
value = line[loc+1:]
dict[key] = value
return dict
def setPr... | true | true |
7908629b18e1e6a7ed63ddf360a5dba333406511 | 3,312 | py | Python | biostar/server/search.py | biostars/support.bioconductor.org | 2416b6f4ec82fce3e69a218a616761a934f82bb5 | [
"MIT"
] | 1 | 2021-08-01T23:26:12.000Z | 2021-08-01T23:26:12.000Z | biostar/server/search.py | biostars/support.bioconductor.org | 2416b6f4ec82fce3e69a218a616761a934f82bb5 | [
"MIT"
] | null | null | null | biostar/server/search.py | biostars/support.bioconductor.org | 2416b6f4ec82fce3e69a218a616761a934f82bb5 | [
"MIT"
] | 1 | 2020-03-12T07:24:27.000Z | 2020-03-12T07:24:27.000Z | __author__ = 'ialbert'
from django.views.generic import DetailView, ListView, TemplateView, RedirectView, View
from haystack.views import SearchView
from haystack.forms import SearchForm
from haystack.query import SearchQuerySet, AutoQuery
from haystack.utils import Highlighter
from django.conf import settings
from bi... | 28.067797 | 93 | 0.658514 | __author__ = 'ialbert'
from django.views.generic import DetailView, ListView, TemplateView, RedirectView, View
from haystack.views import SearchView
from haystack.forms import SearchForm
from haystack.query import SearchQuerySet, AutoQuery
from haystack.utils import Highlighter
from django.conf import settings
from bi... | false | true |
790862d99c8d496659a9bab0c632f446cf9f32c5 | 2,671 | py | Python | lacaudiofiles/wave/wavefile.py | landmarkacoustics/lac-audio-files | a6658513dc34ac66d7d3cb1c08ec1649af963a0d | [
"MIT"
] | null | null | null | lacaudiofiles/wave/wavefile.py | landmarkacoustics/lac-audio-files | a6658513dc34ac66d7d3cb1c08ec1649af963a0d | [
"MIT"
] | null | null | null | lacaudiofiles/wave/wavefile.py | landmarkacoustics/lac-audio-files | a6658513dc34ac66d7d3cb1c08ec1649af963a0d | [
"MIT"
] | null | null | null | # Copyright (C) 2019 by Landmark Acoustics LLC
r"""A class to write a WAV-formatted file."""
import wave
class WaveFile:
'''A wrapper for `Wave_write` from Python STL's `wave` module.
Parameters
----------
name : str
The name to save the file as. It should include path and extension.
sa... | 25.932039 | 77 | 0.592662 |
import wave
class WaveFile:
def __init__(self,
name: str,
sample_rate: int,
bit_rate: int,
channels: int) -> None:
self._channels = channels
self._sample_rate = sample_rate
self._byte_rate = bit_rate // 8
self._... | true | true |
790863fed04ec75f17df4b4acdbdb2b1ea5aed25 | 882 | py | Python | var/spack/repos/builtin/packages/r-rrblup/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2015-10-04T02:17:46.000Z | 2018-02-07T18:23:00.000Z | var/spack/repos/builtin/packages/r-rrblup/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 22 | 2017-08-01T22:45:10.000Z | 2022-03-10T07:46:31.000Z | var/spack/repos/builtin/packages/r-rrblup/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 4 | 2016-06-10T17:57:39.000Z | 2018-09-11T04:59:38.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RRrblup(RPackage):
"""Ridge Regression and Other Kernels for Genomic Selection.
Softw... | 36.75 | 95 | 0.756236 |
from spack import *
class RRrblup(RPackage):
cran = "rrBLUP"
version('4.6.1', sha256='e9230e74cc430a83ac5567071cb1c7f00b35c368f7d79bcc1cfde7225446c4db')
version('4.6', sha256='28b475a1466fcdc1780caace75cf34155338fda496cebd5799315598a4bc84af')
depends_on('r@2.14:', type=('build', 'run'))
| true | true |
790864759a4b957bdc3d35e7e37654553a7be404 | 405 | py | Python | backend/withposh_34166/wsgi.py | crowdbotics-apps/withposh-34166 | 429203738310d89abbeb5ff49385446ab5a791cf | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/withposh_34166/wsgi.py | crowdbotics-apps/withposh-34166 | 429203738310d89abbeb5ff49385446ab5a791cf | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/withposh_34166/wsgi.py | crowdbotics-apps/withposh-34166 | 429203738310d89abbeb5ff49385446ab5a791cf | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
WSGI config for withposh_34166 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANG... | 23.823529 | 78 | 0.792593 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'withposh_34166.settings')
application = get_wsgi_application()
| true | true |
790864e9db53c51cd3c475e3ea5632f7442923c7 | 302 | py | Python | src/stump_data_pipeline/mongo_client.py | stump-vote/stump-data-pipeline | 7a8a27577f20cc4f4bdcbf20fe9664b69efa6953 | [
"MIT"
] | null | null | null | src/stump_data_pipeline/mongo_client.py | stump-vote/stump-data-pipeline | 7a8a27577f20cc4f4bdcbf20fe9664b69efa6953 | [
"MIT"
] | null | null | null | src/stump_data_pipeline/mongo_client.py | stump-vote/stump-data-pipeline | 7a8a27577f20cc4f4bdcbf20fe9664b69efa6953 | [
"MIT"
] | 1 | 2020-04-05T02:45:37.000Z | 2020-04-05T02:45:37.000Z | import pymongo
def connect_to_mongo(username="", password="", host="localhost", port=27017):
credentials = ""
if username and password:
credentials = f"{username}:{password}@"
connection_url = f"mongodb://{credentials}{host}:{port}"
return pymongo.MongoClient(connection_url)
| 30.2 | 77 | 0.692053 | import pymongo
def connect_to_mongo(username="", password="", host="localhost", port=27017):
credentials = ""
if username and password:
credentials = f"{username}:{password}@"
connection_url = f"mongodb://{credentials}{host}:{port}"
return pymongo.MongoClient(connection_url)
| true | true |
790865bb249f2d32e173e8e186585acbc7d6f77e | 3,179 | py | Python | examples/python/image_transfer.py | seatable/seatable-scripts-cn | 2d1637207e1a7339406eeee33be62801f97e2566 | [
"Apache-2.0"
] | 12 | 2020-09-24T09:52:18.000Z | 2022-02-16T00:53:23.000Z | examples/python/image_transfer.py | seatable/seatable-scripts-cn | 2d1637207e1a7339406eeee33be62801f97e2566 | [
"Apache-2.0"
] | 1 | 2021-04-06T18:32:11.000Z | 2021-11-18T06:39:45.000Z | examples/python/image_transfer.py | seatable/seatable-scripts-cn | 2d1637207e1a7339406eeee33be62801f97e2566 | [
"Apache-2.0"
] | 6 | 2020-08-27T03:39:49.000Z | 2021-12-16T06:03:41.000Z | from seatable_api import Base, context
import requests
import time
import os
"""
该脚本用于从图片链接下载图片到图片列。你可以在一个文本列中记录图片的地址,然后用这个
脚本自动下载图片并上传到图片列中。
"""
###################---基本信息配置---###################
SERVER_URL = context.server_url or 'https://cloud.seatable.cn/'
API_TOKEN = context.api_token or 'cacc4249788... | 34.182796 | 134 | 0.538534 | from seatable_api import Base, context
import requests
import time
import os
if __name__ == "__main__":
img_transfer()
| true | true |
7908669448f59ba23183ec8280e62b4adee09b21 | 494 | py | Python | telegramsLibs/api_telega_intro.py | keys4words/bots | 4f5c4342ad24d1fc9d39947c9940346d2ac2ec8b | [
"Apache-2.0"
] | null | null | null | telegramsLibs/api_telega_intro.py | keys4words/bots | 4f5c4342ad24d1fc9d39947c9940346d2ac2ec8b | [
"Apache-2.0"
] | 7 | 2020-11-09T13:35:15.000Z | 2021-10-22T04:58:07.000Z | telegramsLibs/api_telega_intro.py | keys4words/bots | 4f5c4342ad24d1fc9d39947c9940346d2ac2ec8b | [
"Apache-2.0"
] | null | null | null | import requests
import pprint
from config import API_KEY
base_url = f'https://api.telegram.org/bot{API_KEY}/'
api_response = requests.get(base_url + 'getUpdates').json()
for update in api_response['result']:
message = update['message']
chat_id = message['chat']['id']
text = message['text']
reply_... | 24.7 | 63 | 0.668016 | import requests
import pprint
from config import API_KEY
base_url = f'https://api.telegram.org/bot{API_KEY}/'
api_response = requests.get(base_url + 'getUpdates').json()
for update in api_response['result']:
message = update['message']
chat_id = message['chat']['id']
text = message['text']
reply_... | true | true |
7908669c40a9de8ad57713317cc128f2f11fa349 | 37,793 | py | Python | qlib/data/data.py | Tirbo06/qlib | ad0afc111cf27777bc05d712006ee5b14cc77840 | [
"MIT"
] | 1 | 2020-10-15T20:18:09.000Z | 2020-10-15T20:18:09.000Z | qlib/data/data.py | Tirbo06/qlib | ad0afc111cf27777bc05d712006ee5b14cc77840 | [
"MIT"
] | null | null | null | qlib/data/data.py | Tirbo06/qlib | ad0afc111cf27777bc05d712006ee5b14cc77840 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from __future__ import division
from __future__ import print_function
import os
import abc
import six
import time
import queue
import bisect
import logging
import importlib
import traceback
import numpy as np
import pandas as pd
from multiproce... | 34.017102 | 362 | 0.594872 |
from __future__ import division
from __future__ import print_function
import os
import abc
import six
import time
import queue
import bisect
import logging
import importlib
import traceback
import numpy as np
import pandas as pd
from multiprocessing import Pool
from .cache import H
from ..config import C
from .op... | true | true |
790866a68399b005c227ee8b532afb93d8a5e92f | 324 | py | Python | workshops/migrations/0063_merge.py | tracykteal/amy | cb19e318d36b880b1c3be2104efff42ef776118a | [
"MIT"
] | 1 | 2015-04-03T20:26:56.000Z | 2015-04-03T20:26:56.000Z | workshops/migrations/0063_merge.py | tracykteal/amy | cb19e318d36b880b1c3be2104efff42ef776118a | [
"MIT"
] | 1 | 2019-12-13T11:22:47.000Z | 2019-12-13T11:22:47.000Z | workshops/migrations/0063_merge.py | tracykteal/amy | cb19e318d36b880b1c3be2104efff42ef776118a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('workshops', '0062_no_invoice_for_historic_events'),
('workshops', '0062_add_stalled_unresponsive_tags'),
]
operations = [
... | 20.25 | 61 | 0.685185 |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('workshops', '0062_no_invoice_for_historic_events'),
('workshops', '0062_add_stalled_unresponsive_tags'),
]
operations = [
]
| true | true |
790867292a1e779c8cdc2a8421fe4de1306821b9 | 5,993 | py | Python | magenta/common/sequence_example_lib.py | sandutsar/magenta | 77ed668af96edea7c993d38973b9da342bd31e82 | [
"Apache-2.0"
] | 16,143 | 2016-05-14T04:44:54.000Z | 2020-06-04T06:48:38.000Z | magenta/common/sequence_example_lib.py | sandutsar/magenta | 77ed668af96edea7c993d38973b9da342bd31e82 | [
"Apache-2.0"
] | 1,076 | 2016-05-19T14:13:43.000Z | 2020-06-04T16:36:51.000Z | magenta/common/sequence_example_lib.py | sandutsar/magenta | 77ed668af96edea7c993d38973b9da342bd31e82 | [
"Apache-2.0"
] | 3,584 | 2016-05-14T05:55:19.000Z | 2020-06-04T17:53:50.000Z | # Copyright 2022 The Magenta Authors.
#
# 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 ... | 37.223602 | 80 | 0.724345 |
import math
import tensorflow.compat.v1 as tf
QUEUE_CAPACITY = 500
SHUFFLE_MIN_AFTER_DEQUEUE = QUEUE_CAPACITY // 5
def _shuffle_inputs(input_tensors, capacity, min_after_dequeue, num_threads):
shuffle_queue = tf.RandomShuffleQueue(
capacity, min_after_dequeue, dtypes=[t.dtype for t in input_t... | true | true |
790867d546611cbc16c04826a8f2387d1d94abf9 | 9,998 | py | Python | statsmodels/sandbox/tests/test_formula.py | jarvmiller/statsmodels | 15e90a99c81dd0b61c1aa76ebda2df008e88870d | [
"BSD-3-Clause"
] | 6 | 2017-08-23T12:43:44.000Z | 2021-08-18T08:20:15.000Z | statsmodels/sandbox/tests/test_formula.py | jarvmiller/statsmodels | 15e90a99c81dd0b61c1aa76ebda2df008e88870d | [
"BSD-3-Clause"
] | null | null | null | statsmodels/sandbox/tests/test_formula.py | jarvmiller/statsmodels | 15e90a99c81dd0b61c1aa76ebda2df008e88870d | [
"BSD-3-Clause"
] | 3 | 2017-08-23T12:43:49.000Z | 2018-04-24T02:27:33.000Z | """
Test functions for models.formula
"""
import string
import numpy as np
import numpy.random as R
import numpy.linalg as L
from numpy.testing import assert_almost_equal, assert_equal, assert_, \
assert_raises
from statsmodels.sandbox import formula #, contrast #, utils
from statsmodels.sandbox import contrast_... | 31.639241 | 145 | 0.534407 |
import string
import numpy as np
import numpy.random as R
import numpy.linalg as L
from numpy.testing import assert_almost_equal, assert_equal, assert_, \
assert_raises
from statsmodels.sandbox import formula atsmodels.sandbox import contrast_old as contrast
class TestTerm(object):
def test_init(self):
... | true | true |
7908689ce4a719ab15bd49a368a87f9cad7c6d61 | 11,740 | py | Python | tensorflow/contrib/lite/python/op_hint.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 71 | 2017-05-25T16:02:15.000Z | 2021-06-09T16:08:08.000Z | tensorflow/contrib/lite/python/op_hint.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 133 | 2017-04-26T16:49:49.000Z | 2019-10-15T11:39:26.000Z | tensorflow/contrib/lite/python/op_hint.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 31 | 2018-09-11T02:17:17.000Z | 2021-12-15T10:33:35.000Z | # Copyright 2017 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... | 37.993528 | 80 | 0.725639 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections as _collections
import itertools as _itertools
import uuid as _uuid
from tensorflow.contrib import framework as _framework
from tensorflow.core.framework import attr_value_pb2... | true | true |
7908697ff9cc4b3365466309dd5c999fcebecc22 | 659 | py | Python | utils/locators.py | gunesmes/page-object-python-selenium | c4b181dc57ece7b920e67811bdd6bbf7bebbd7ee | [
"MIT"
] | 176 | 2015-05-15T18:01:57.000Z | 2022-03-29T05:06:32.000Z | utils/locators.py | shashwatahalder01/page-object-python-selenium | c4b181dc57ece7b920e67811bdd6bbf7bebbd7ee | [
"MIT"
] | 1 | 2018-01-12T20:36:29.000Z | 2018-01-12T20:36:29.000Z | utils/locators.py | shashwatahalder01/page-object-python-selenium | c4b181dc57ece7b920e67811bdd6bbf7bebbd7ee | [
"MIT"
] | 103 | 2015-08-17T00:31:14.000Z | 2022-03-28T08:20:14.000Z | from selenium.webdriver.common.by import By
# for maintainability we can seperate web objects by page name
class MainPageLocators(object):
LOGO = (By.ID, 'nav-logo')
ACCOUNT = (By.ID, 'nav-link-accountList')
SIGNUP = (By.CSS_SELECTOR, '#nav-signin-tooltip > div > a')
LOGIN = (By.CSS_SELECTOR, '#nav-s... | 32.95 | 81 | 0.6783 | from selenium.webdriver.common.by import By
class MainPageLocators(object):
LOGO = (By.ID, 'nav-logo')
ACCOUNT = (By.ID, 'nav-link-accountList')
SIGNUP = (By.CSS_SELECTOR, '#nav-signin-tooltip > div > a')
LOGIN = (By.CSS_SELECTOR, '#nav-signin-tooltip > a')
SEARCH = (By.ID, 'twotabsearchtextbox'... | true | true |
79086ad19879f9b7884c14974c6adef58fe06ae2 | 1,635 | py | Python | CovertMark/constants.py | chongyangshi/CovertMark | a3156b45acceadf5fc1b9a56fa56550b4893c285 | [
"MIT"
] | 4 | 2021-01-04T09:00:33.000Z | 2021-10-02T13:37:03.000Z | CovertMark/constants.py | chongyangshi/CovertMark | a3156b45acceadf5fc1b9a56fa56550b4893c285 | [
"MIT"
] | null | null | null | CovertMark/constants.py | chongyangshi/CovertMark | a3156b45acceadf5fc1b9a56fa56550b4893c285 | [
"MIT"
] | null | null | null | """
This module stores constants used during the operations of the UI.
"""
# Application info.
CM_NAME = "CovertMark"
CM_VER = "0.1"
CM_RELEASE = "alpha"
CM_AUTHOR = "C Shi"
CM_LINK = "https://github.com/chongyangshi"
CM_LICENSE = "Please see LICENSE.md for terms of usage of this program."
CM_TITLE = """\
_____ ... | 33.367347 | 180 | 0.582875 |
CM_NAME = "CovertMark"
CM_VER = "0.1"
CM_RELEASE = "alpha"
CM_AUTHOR = "C Shi"
CM_LINK = "https://github.com/chongyangshi"
CM_LICENSE = "Please see LICENSE.md for terms of usage of this program."
CM_TITLE = """\
_____ _ ___ ___ _
/ __ \ | | | \/ | | |
| /... | true | true |
79086b55e56304e633779fa6b9b599a688b49686 | 8,157 | py | Python | src/ohsome/tests/test_ohsome_client.py | redfrexx/osm_association_rules | 33975ce25047f9ab3b21e890bc5ed9bab59a0a2f | [
"BSD-3-Clause"
] | null | null | null | src/ohsome/tests/test_ohsome_client.py | redfrexx/osm_association_rules | 33975ce25047f9ab3b21e890bc5ed9bab59a0a2f | [
"BSD-3-Clause"
] | null | null | null | src/ohsome/tests/test_ohsome_client.py | redfrexx/osm_association_rules | 33975ce25047f9ab3b21e890bc5ed9bab59a0a2f | [
"BSD-3-Clause"
] | 2 | 2021-05-10T10:19:13.000Z | 2021-09-15T10:32:10.000Z | #!/usr/bin/env python
"""
Tests for ohsome client
"""
import os
import pandas as pd
from nose.tools import raises
import geojson
import geopandas as gpd
import ohsome
@raises(ohsome.OhsomeException)
def test_handle_multiple_responses_throw_timeouterror():
"""
Tests counting elements within a bounding box for... | 32.628 | 125 | 0.55388 |
import os
import pandas as pd
from nose.tools import raises
import geojson
import geopandas as gpd
import ohsome
@raises(ohsome.OhsomeException)
def test_handle_multiple_responses_throw_timeouterror():
bboxes = [8.67066,49.41423,8.68177,49.4204]
time = "2010-01-01/2011-01-01/P1Y"
keys = ["building"... | true | true |
79086b9baa6bccfa683766ed58e78a2863a0073a | 5,013 | py | Python | demo/hrnet_w32_coco_256x192.py | vineethbabu/mmaction2 | f2e4289807c95bad7dd83757a49c5d9ebd2f881e | [
"Apache-2.0"
] | 1 | 2021-12-06T08:42:23.000Z | 2021-12-06T08:42:23.000Z | demo/hrnet_w32_coco_256x192.py | wuyy258/mmaction2 | 3f3ad9cae291c991b822cbc2ecfb88c1188e87c5 | [
"Apache-2.0"
] | null | null | null | demo/hrnet_w32_coco_256x192.py | wuyy258/mmaction2 | 3f3ad9cae291c991b822cbc2ecfb88c1188e87c5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
log_level = 'INFO'
load_from = None
resume_from = None
dist_params = dict(backend='nccl')
workflow = [('train', 1)]
checkpoint_config = dict(interval=10)
evaluation = dict(interval=10, metric='mAP', key_indicator='AP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
op... | 28.810345 | 79 | 0.591063 |
log_level = 'INFO'
load_from = None
resume_from = None
dist_params = dict(backend='nccl')
workflow = [('train', 1)]
checkpoint_config = dict(interval=10)
evaluation = dict(interval=10, metric='mAP', key_indicator='AP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
lr_confi... | true | true |
79086cd5adae52deb112b0cc2e985ad98c92d82d | 23,578 | py | Python | dassl/engine/trainer.py | zhaoxin94/Dassl.pytorch | c0690f3669c561f2ed7410c22fc65eaef30dfd22 | [
"MIT"
] | 1 | 2021-07-25T10:19:02.000Z | 2021-07-25T10:19:02.000Z | dassl/engine/trainer.py | zhaoxin94/Dassl.pytorch | c0690f3669c561f2ed7410c22fc65eaef30dfd22 | [
"MIT"
] | null | null | null | dassl/engine/trainer.py | zhaoxin94/Dassl.pytorch | c0690f3669c561f2ed7410c22fc65eaef30dfd22 | [
"MIT"
] | null | null | null | import time
import numpy as np
import os.path as osp
import datetime
from collections import OrderedDict
import torch
import torch.nn as nn
from torch.utils.tensorboard import SummaryWriter
import nni
from dassl.data import DataManager
from dassl.optim import build_optimizer, build_lr_scheduler
from dassl.utils import... | 33.30226 | 97 | 0.57015 | import time
import numpy as np
import os.path as osp
import datetime
from collections import OrderedDict
import torch
import torch.nn as nn
from torch.utils.tensorboard import SummaryWriter
import nni
from dassl.data import DataManager
from dassl.optim import build_optimizer, build_lr_scheduler
from dassl.utils import... | true | true |
79086cf415b3df58a648cc1b688198fca1325d34 | 9,165 | py | Python | python/3.2/Pubnub.py | goodybag/pubnub-api | 7d37385f5dc58551c4e73674d35a26b0f239cc06 | [
"MIT"
] | null | null | null | python/3.2/Pubnub.py | goodybag/pubnub-api | 7d37385f5dc58551c4e73674d35a26b0f239cc06 | [
"MIT"
] | null | null | null | python/3.2/Pubnub.py | goodybag/pubnub-api | 7d37385f5dc58551c4e73674d35a26b0f239cc06 | [
"MIT"
] | null | null | null | ## www.pubnub.com - PubNub Real-time push service in the cloud.
# coding=utf8
## PubNub Real-time Push APIs and Notifications Framework
## Copyright (c) 2010 Stephen Blum
## http://www.pubnub.com/
## -----------------------------------
## PubNub 3.0 Real-time Push Cloud API
## -----------------------------------
tr... | 26.488439 | 114 | 0.481069 | n = 'pubsub.pubnub.com',
pres_uuid = None
) :
self.origin = origin
self.limit = 1800
self.publish_key = publish_key
self.subscribe_key = subscribe_key
self.secret_key = secret_key
self.ssl = ssl_on
if self.ssl :
... | true | true |
79086d64a14b56e12fb10948fc468d18dfb75294 | 8,125 | py | Python | misc/python/materialize/cli/mzbench.py | sungchun12/materialize | 7282293960368019d583163b2f06545b1379c0a1 | [
"MIT"
] | null | null | null | misc/python/materialize/cli/mzbench.py | sungchun12/materialize | 7282293960368019d583163b2f06545b1379c0a1 | [
"MIT"
] | 49 | 2021-07-20T18:33:05.000Z | 2022-03-28T22:15:20.000Z | misc/python/materialize/cli/mzbench.py | sungchun12/materialize | 7282293960368019d583163b2f06545b1379c0a1 | [
"MIT"
] | null | null | null | # Copyright Materialize, Inc. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file at the root of this repository.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software will be governed
... | 31.130268 | 98 | 0.610092 |
import argparse
import csv
import itertools
import multiprocessing
import os
import pathlib
import subprocess
import sys
import typing
import uuid
import webbrowser
def mzbuild_tag(git_ref: str) -> str:
if not git_ref:
return git_ref
try:
return (
subprocess.check_output... | true | true |
79086dbd3c6207c0aff9b746906ada863490ee0e | 39,901 | py | Python | timesketch/lib/datastores/elastic.py | toshiro92/timesketch | 3c8f39e2599dfab412412ff6787bc2c40e199f5f | [
"Apache-2.0"
] | null | null | null | timesketch/lib/datastores/elastic.py | toshiro92/timesketch | 3c8f39e2599dfab412412ff6787bc2c40e199f5f | [
"Apache-2.0"
] | null | null | null | timesketch/lib/datastores/elastic.py | toshiro92/timesketch | 3c8f39e2599dfab412412ff6787bc2c40e199f5f | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 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 by applicable law or a... | 36.673713 | 170 | 0.524774 |
from __future__ import unicode_literals
from collections import Counter
import copy
import codecs
import json
import logging
import socket
from uuid import uuid4
import six
from dateutil import parser, relativedelta
from elasticsearch import Elasticsearch
from elasticsearch.exceptions import ConnectionTi... | true | true |
79086dcff1ed12f2fb081ac280624f3e8c4a1686 | 24,031 | py | Python | nova/tests/unit/api/openstack/fakes.py | mmnelemane/nova_stable_juno | e049553c7312480080091ad2481dcaf49113d571 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/api/openstack/fakes.py | mmnelemane/nova_stable_juno | e049553c7312480080091ad2481dcaf49113d571 | [
"Apache-2.0"
] | 1 | 2021-03-21T11:39:52.000Z | 2021-03-21T11:39:52.000Z | nova/tests/unit/api/openstack/fakes.py | mmnelemane/nova_stable_juno | e049553c7312480080091ad2481dcaf49113d571 | [
"Apache-2.0"
] | 1 | 2021-03-21T11:37:33.000Z | 2021-03-21T11:37:33.000Z | # Copyright 2010 OpenStack Foundation
# 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 requ... | 33.100551 | 79 | 0.624402 |
import datetime
import uuid
from oslo_serialization import jsonutils
from oslo_utils import netutils
from oslo_utils import timeutils
import routes
import six
from six.moves import range
import webob
import webob.dec
import webob.request
from nova.api import auth as api_auth
from nova.api import openst... | true | true |
79086f3324c1f07e8fa8af6bd70c4d211628eab7 | 1,160 | py | Python | hooks/post_gen_project.py | glyg/cookiecutter-flask | 3aef56e4169308b52dc405e2d475ad3357b93f3c | [
"MIT"
] | 1 | 2016-12-06T03:10:09.000Z | 2016-12-06T03:10:09.000Z | hooks/post_gen_project.py | glyg/cookiecutter-flask | 3aef56e4169308b52dc405e2d475ad3357b93f3c | [
"MIT"
] | 146 | 2021-03-18T07:07:52.000Z | 2022-03-25T22:07:02.000Z | hooks/post_gen_project.py | moxuanchen/cookiecutter-flask | 649818848bf401e1a1e5e4397c4eb19e0f801812 | [
"MIT"
] | null | null | null | """Post gen hook to ensure that the generated project
has only one package management, either pipenv or pip."""
import logging
import os
import shutil
import sys
_logger = logging.getLogger()
def clean_extra_package_management_files():
"""Removes either requirements files and folder or the Pipfile."""
use_pi... | 28.292683 | 79 | 0.637931 | import logging
import os
import shutil
import sys
_logger = logging.getLogger()
def clean_extra_package_management_files():
use_pipenv = "{{cookiecutter.use_pipenv}}"
use_heroku = "{{cookiecutter.use_heroku}}"
to_delete = []
if use_pipenv == "yes":
to_delete = to_delete + ["requirements.txt"... | true | true |
79087125bbd37efa9befe18eb7b00bad23b84183 | 1,577 | py | Python | DuoratChar/data/convert.py | WDZRMPCBIT/chase | c23906b109282f7f5ec529279af35964b7c77744 | [
"MIT"
] | null | null | null | DuoratChar/data/convert.py | WDZRMPCBIT/chase | c23906b109282f7f5ec529279af35964b7c77744 | [
"MIT"
] | null | null | null | DuoratChar/data/convert.py | WDZRMPCBIT/chase | c23906b109282f7f5ec529279af35964b7c77744 | [
"MIT"
] | null | null | null | import json
import os
import argparse
def main(split):
with open(args.data_path + '/' + split + '.json') as f:
data = json.load(f)
sparc = []
for i in range(len(data)):
d = data[i]
for j in range(len(d['interaction'])):
turn = d['interaction'][j]
sparc.appen... | 35.840909 | 94 | 0.492708 | import json
import os
import argparse
def main(split):
with open(args.data_path + '/' + split + '.json') as f:
data = json.load(f)
sparc = []
for i in range(len(data)):
d = data[i]
for j in range(len(d['interaction'])):
turn = d['interaction'][j]
sparc.appen... | true | true |
790872f131452d532e5c7b2a86e596058a502cb9 | 1,572 | py | Python | credit-card-fraud/src/features/build_features.py | samie-hash/data-science-repo | 574ebad704e3f2ebce18f573af87cd95571b4cc9 | [
"MIT"
] | null | null | null | credit-card-fraud/src/features/build_features.py | samie-hash/data-science-repo | 574ebad704e3f2ebce18f573af87cd95571b4cc9 | [
"MIT"
] | null | null | null | credit-card-fraud/src/features/build_features.py | samie-hash/data-science-repo | 574ebad704e3f2ebce18f573af87cd95571b4cc9 | [
"MIT"
] | null | null | null | # build_features.py
# This module holds utility classes and functions that creates and manipulates input features
# This module also holds the various input transformers
import numpy as np
import pandas as pd
from sklearn.base import BaseEstimator, TransformerMixin
def correlation_columns(dataset: pd.DataFrame, targe... | 29.660377 | 119 | 0.692112 |
import numpy as np
import pandas as pd
from sklearn.base import BaseEstimator, TransformerMixin
def correlation_columns(dataset: pd.DataFrame, target_column: str, k: float=0.5):
corr = np.abs(dataset.corr()[target_column])
corr_sorted = corr.sort_values(ascending=False)
columns = [col for col, value i... | true | true |
790873705a04a5482d6eb62a668a5405a1019ab5 | 11,218 | py | Python | docs/conf.py | adafruit/Adafruit_MicroPython_PCF8523 | 78f5162c5db5832d6654d99042936db265d01f26 | [
"MIT",
"MIT-0",
"Unlicense"
] | null | null | null | docs/conf.py | adafruit/Adafruit_MicroPython_PCF8523 | 78f5162c5db5832d6654d99042936db265d01f26 | [
"MIT",
"MIT-0",
"Unlicense"
] | null | null | null | docs/conf.py | adafruit/Adafruit_MicroPython_PCF8523 | 78f5162c5db5832d6654d99042936db265d01f26 | [
"MIT",
"MIT-0",
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
#
# SPDX-License-Identifier: MIT
#
# Adafruit PCF8523 RTC Library documentation build configuration file, created by
# sphinx-quickstart on Fri Nov 11 21:37:36 2016.
#
# This file is execfile()d with the current directory set to its
... | 29.598945 | 85 | 0.700214 |
import os
import sys
sys.path.insert(0, os.path.abspath(".."))
extensions = ["sphinx.ext.autodoc", "sphinx.ext.todo", "sphinx.ext.intersphinx"]
templates_path = ["_templates"]
source_suffix = [".rst", ".md"]
master_doc = "index"
project = "Adafruit PCF8523 RTC Library... | true | true |
7908755cd17f8c5d8f139d16b941849fc55fe625 | 519 | py | Python | examples/simple_sweep/rosen_1.py | zoidy/puq | ed70f113f7c135ee61adeebfc9bd18c541970caf | [
"MIT"
] | null | null | null | examples/simple_sweep/rosen_1.py | zoidy/puq | ed70f113f7c135ee61adeebfc9bd18c541970caf | [
"MIT"
] | null | null | null | examples/simple_sweep/rosen_1.py | zoidy/puq | ed70f113f7c135ee61adeebfc9bd18c541970caf | [
"MIT"
] | null | null | null | from puq import *
import numpy as np
# test case with just a single point
def run():
# Declare our parameters here. Both are uniform on [-2, 2]
x = UniformParameter('x', 'x', min=-2, max=2)
y = UniformParameter('y', 'y', min=-2, max=2)
# Create a host
host = InteractiveHost()
# any of these ... | 23.590909 | 62 | 0.597303 | from puq import *
import numpy as np
def run():
x = UniformParameter('x', 'x', min=-2, max=2)
y = UniformParameter('y', 'y', min=-2, max=2)
host = InteractiveHost()
valarray = [[-1,0,1], [0,0,0]]
uq = SimpleSweep([x,y], valarray)
prog = TestProgram('./rosen_prog.py')
... | true | true |
7908758620b02ca7311d63dcbdc7574cbd5dd6ab | 5,012 | py | Python | src/bionev/evaluation.py | bhevencious/BioNEV | 3ec46c503fb147a8fb1b017d90b0f4ba2317f8f7 | [
"MIT"
] | 1 | 2021-05-30T05:32:10.000Z | 2021-05-30T05:32:10.000Z | src/bionev/evaluation.py | bhevencious/BioNEV | 3ec46c503fb147a8fb1b017d90b0f4ba2317f8f7 | [
"MIT"
] | null | null | null | src/bionev/evaluation.py | bhevencious/BioNEV | 3ec46c503fb147a8fb1b017d90b0f4ba2317f8f7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score, average_precision_score, precision_score, recall_score, f1_score, roc_auc_score, matthews_corrcoef
from sklearn.multiclass import OneVsRestClassifier
from sklearn.preprocessing import MultiLabelBinar... | 39.15625 | 204 | 0.67937 |
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score, average_precision_score, precision_score, recall_score, f1_score, roc_auc_score, matthews_corrcoef
from sklearn.multiclass import OneVsRestClassifier
from sklearn.preprocessing import MultiLabelBinarizer
from bionev.utils... | true | true |
79087737c1dbee45d9da6d2e19b2f69e5847f1c9 | 1,466 | py | Python | exotica_python/src/pyexotica/publish_trajectory.py | LongfeiProjects/exotica | 206b296edf9bf3b653ca3984b1449151ca17d374 | [
"BSD-3-Clause"
] | 1 | 2019-04-12T20:26:59.000Z | 2019-04-12T20:26:59.000Z | exotica_python/src/pyexotica/publish_trajectory.py | LongfeiProjects/exotica | 206b296edf9bf3b653ca3984b1449151ca17d374 | [
"BSD-3-Clause"
] | null | null | null | exotica_python/src/pyexotica/publish_trajectory.py | LongfeiProjects/exotica | 206b296edf9bf3b653ca3984b1449151ca17d374 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function
from time import sleep
import matplotlib.pyplot as plt
import signal
def sigIntHandler(signal, frame):
raise KeyboardInterrupt
def publishPose(q, problem, t=0.0):
problem.getScene().Update(q, t)
problem.getScene().getSolver().publishFrames()
def publishTrajectory(... | 24.847458 | 64 | 0.595498 | from __future__ import print_function
from time import sleep
import matplotlib.pyplot as plt
import signal
def sigIntHandler(signal, frame):
raise KeyboardInterrupt
def publishPose(q, problem, t=0.0):
problem.getScene().Update(q, t)
problem.getScene().getSolver().publishFrames()
def publishTrajectory(... | true | true |
7908779da07bb5ebf13361570653d8dfae22a5d9 | 7,969 | py | Python | pointer_network.py | 00wuweimin/jubilant-dollop | cc91caf8ee7aba5824abe25cbb3870299b369f91 | [
"Apache-2.0"
] | null | null | null | pointer_network.py | 00wuweimin/jubilant-dollop | cc91caf8ee7aba5824abe25cbb3870299b369f91 | [
"Apache-2.0"
] | null | null | null | pointer_network.py | 00wuweimin/jubilant-dollop | cc91caf8ee7aba5824abe25cbb3870299b369f91 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
from torch import optim
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
import matplotlib.pyplot as plt
train_data = np.load("E:\\quant_research\\train the rank of ten points\\RNN_point\\data\\train_data_10num.npy")
train_aim = np.loa... | 37.589623 | 146 | 0.648638 | import torch
import torch.nn as nn
from torch import optim
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
import matplotlib.pyplot as plt
train_data = np.load("E:\\quant_research\\train the rank of ten points\\RNN_point\\data\\train_data_10num.npy")
train_aim = np.loa... | true | true |
790877aec35bcd0a4897d4505442464175c1d3d6 | 1,654 | py | Python | services/syslogcollector/syslogserver.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 84 | 2017-10-22T11:01:39.000Z | 2022-02-27T03:43:48.000Z | services/syslogcollector/syslogserver.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 22 | 2017-12-11T07:21:56.000Z | 2021-09-23T02:53:50.000Z | services/syslogcollector/syslogserver.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 23 | 2017-12-06T06:59:52.000Z | 2022-02-24T00:02:25.000Z | # ---------------------------------------------------------------------
# Syslog server
# ---------------------------------------------------------------------
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
# Python modules
im... | 30.072727 | 99 | 0.538089 |
import logging
import time
from typing import Tuple
from noc.config import config
from noc.core.perf import metrics
from noc.core.ioloop.udpserver import UDPServer
from noc.core.comp import smart_text
logger = logging.getLogger(__name__)
class SyslogServer(UDPServer):
def __init__(self, service):
... | true | true |
79087905447cd6452d3c2ca48a0be3d6d1fb92ec | 3,152 | py | Python | up/utils/general/cfg_helper.py | ModelTC/EOD | 164bff80486e9ae6a095a97667b365c46ceabd86 | [
"Apache-2.0"
] | 196 | 2021-10-30T05:15:36.000Z | 2022-03-30T18:43:40.000Z | up/utils/general/cfg_helper.py | ModelTC/EOD | 164bff80486e9ae6a095a97667b365c46ceabd86 | [
"Apache-2.0"
] | 12 | 2021-10-30T11:33:28.000Z | 2022-03-31T14:22:58.000Z | up/utils/general/cfg_helper.py | ModelTC/EOD | 164bff80486e9ae6a095a97667b365c46ceabd86 | [
"Apache-2.0"
] | 23 | 2021-11-01T07:26:17.000Z | 2022-03-27T05:55:37.000Z | # Standard Library
import copy
import json
import re
from .log_helper import default_logger as logger
def format_cfg(cfg):
"""Format experiment config for friendly display"""
# json_str = json.dumps(cfg, indent=2, ensure_ascii=False)
# return json_str
def list2str(cfg):
for key, value in cfg... | 30.901961 | 112 | 0.510152 |
import copy
import json
import re
from .log_helper import default_logger as logger
def format_cfg(cfg):
def list2str(cfg):
for key, value in cfg.items():
if isinstance(value, dict):
cfg[key] = list2str(value)
elif isinstance(value, list):
... | true | true |
79087986bb0bf55f7733843a920fc0e4c0796ec8 | 26 | py | Python | asolut/__init__.py | Marios-Mamalis/asolut | 36bc7f7893b7596d7e7a734dd3013046f9e0c700 | [
"MIT"
] | null | null | null | asolut/__init__.py | Marios-Mamalis/asolut | 36bc7f7893b7596d7e7a734dd3013046f9e0c700 | [
"MIT"
] | null | null | null | asolut/__init__.py | Marios-Mamalis/asolut | 36bc7f7893b7596d7e7a734dd3013046f9e0c700 | [
"MIT"
] | null | null | null | from asolut.main import *
| 13 | 25 | 0.769231 | from asolut.main import *
| true | true |
79087a3b0c4d93b0290d269b6cb4e54c678a9b13 | 484 | py | Python | plotly/validators/scattergl/marker/line/_cmax.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 2 | 2020-03-24T11:41:14.000Z | 2021-01-14T07:59:43.000Z | plotly/validators/scattergl/marker/line/_cmax.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | null | null | null | plotly/validators/scattergl/marker/line/_cmax.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 4 | 2019-06-03T14:49:12.000Z | 2022-01-06T01:05:12.000Z | import _plotly_utils.basevalidators
class CmaxValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self,
plotly_name='cmax',
parent_name='scattergl.marker.line',
**kwargs
):
super(CmaxValidator, self).__init__(
plotly_name=plotly_name,
... | 24.2 | 66 | 0.584711 | import _plotly_utils.basevalidators
class CmaxValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self,
plotly_name='cmax',
parent_name='scattergl.marker.line',
**kwargs
):
super(CmaxValidator, self).__init__(
plotly_name=plotly_name,
... | true | true |
79087ac5f529145040e99aec0cded231ca8fe9d1 | 234 | py | Python | universal_notifications/__init__.py | ArabellaTech/universal_notifications | dc84f412961c1bb5aeecbfb100855cc2db8045b4 | [
"MIT"
] | 15 | 2017-05-03T06:23:38.000Z | 2018-11-02T18:16:32.000Z | universal_notifications/__init__.py | ArabellaTech/universal_notifications | dc84f412961c1bb5aeecbfb100855cc2db8045b4 | [
"MIT"
] | 36 | 2016-12-18T15:07:23.000Z | 2018-11-13T11:54:51.000Z | universal_notifications/__init__.py | HealthByRo/universal_notifications | dc84f412961c1bb5aeecbfb100855cc2db8045b4 | [
"MIT"
] | 3 | 2020-01-08T05:42:46.000Z | 2021-01-27T11:23:47.000Z | # -*- coding: utf-8 -*-
__title__ = "Universal Notifications"
__version__ = "1.5.0"
__author__ = "Pawel Krzyzaniak"
__license__ = "MIT"
__copyright__ = "Copyright 2017-2018 Arabella; 2018+ Ro"
# Version synonym
VERSION = __version__
| 23.4 | 56 | 0.726496 |
__title__ = "Universal Notifications"
__version__ = "1.5.0"
__author__ = "Pawel Krzyzaniak"
__license__ = "MIT"
__copyright__ = "Copyright 2017-2018 Arabella; 2018+ Ro"
VERSION = __version__
| true | true |
79087b023c629fe3bd8d12233d6cbe8af8a4211c | 279 | py | Python | hdbo/febo/solvers/__init__.py | eric-vader/HD-BO-Additive-Models | 0d7e1d46194af2e3d402631caec6e7be9a50376a | [
"MIT"
] | 5 | 2021-03-25T02:58:01.000Z | 2022-02-19T12:58:52.000Z | hdbo/febo/solvers/__init__.py | eric-vader/HD-BO-Additive-Models | 0d7e1d46194af2e3d402631caec6e7be9a50376a | [
"MIT"
] | null | null | null | hdbo/febo/solvers/__init__.py | eric-vader/HD-BO-Additive-Models | 0d7e1d46194af2e3d402631caec6e7be9a50376a | [
"MIT"
] | 1 | 2020-12-27T07:58:46.000Z | 2020-12-27T07:58:46.000Z | """
Optimizers
----------
.. autosummary::
:template: template.rst
:toctree:
Solver
ScipySolver
CandidateSolver
GridSolver
"""
from .solver import Solver
from .scipy import ScipySolver
from .candidate import CandidateSolver, GridSolver, FiniteDomainSolver
| 13.95 | 70 | 0.713262 |
from .solver import Solver
from .scipy import ScipySolver
from .candidate import CandidateSolver, GridSolver, FiniteDomainSolver
| true | true |
79087b8f74439ac7eadad97494f545910570500a | 9,576 | py | Python | controllers/dvi.py | andygimma/eden | 716d5e11ec0030493b582fa67d6f1c35de0af50d | [
"MIT"
] | 1 | 2019-08-20T16:32:33.000Z | 2019-08-20T16:32:33.000Z | controllers/dvi.py | andygimma/eden | 716d5e11ec0030493b582fa67d6f1c35de0af50d | [
"MIT"
] | null | null | null | controllers/dvi.py | andygimma/eden | 716d5e11ec0030493b582fa67d6f1c35de0af50d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Disaster Victim Identification, Controllers
@author: nursix
"""
module = request.controller
resourcename = request.function
if not settings.has_module(module):
raise HTTP(404, body="Module disabled: %s" % module)
# ------------------------------------------------------------... | 32.571429 | 80 | 0.487573 |
module = request.controller
resourcename = request.function
if not settings.has_module(module):
raise HTTP(404, body="Module disabled: %s" % module)
def s3_menu_postp():
menu_selected = []
body_id = s3mgr.get_session("dvi", "body")
if body_id:
body = s3db.dvi_body
query = (bod... | true | true |
79087bb1eb257ab337d645a8213c370d32478ede | 8,037 | py | Python | tests/support/test_collection.py | fenestron/lorator | 1966f095a67ae65e816b1c8f7359b9f203cd5c4f | [
"MIT"
] | null | null | null | tests/support/test_collection.py | fenestron/lorator | 1966f095a67ae65e816b1c8f7359b9f203cd5c4f | [
"MIT"
] | null | null | null | tests/support/test_collection.py | fenestron/lorator | 1966f095a67ae65e816b1c8f7359b9f203cd5c4f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from .. import OratorTestCase
from lorator.support.collection import Collection
class CollectionTestCase(OratorTestCase):
def test_first_returns_first_item_in_collection(self):
c = Collection(["foo", "bar"])
self.assertEqual("foo", c.first())
def test_last_returns_la... | 31.030888 | 86 | 0.520343 |
from .. import OratorTestCase
from lorator.support.collection import Collection
class CollectionTestCase(OratorTestCase):
def test_first_returns_first_item_in_collection(self):
c = Collection(["foo", "bar"])
self.assertEqual("foo", c.first())
def test_last_returns_last_item_in_collection(s... | true | true |
79087c01aa289bbd0ea27566b97b960f8cd46143 | 66 | py | Python | Term 5/Vue/p.py | theseana/fempfasb | bb6776f9ea00225d4653097f746b866de8ffac1b | [
"MIT"
] | 1 | 2022-01-16T00:31:01.000Z | 2022-01-16T00:31:01.000Z | Term 5/Vue/p.py | theseana/fempfasb | bb6776f9ea00225d4653097f746b866de8ffac1b | [
"MIT"
] | null | null | null | Term 5/Vue/p.py | theseana/fempfasb | bb6776f9ea00225d4653097f746b866de8ffac1b | [
"MIT"
] | null | null | null | todos = ['barber', 'grocery']
for todo in todos:
print(todo) | 16.5 | 30 | 0.621212 | todos = ['barber', 'grocery']
for todo in todos:
print(todo) | true | true |
79087d50bf1f82f1ab98d792904d760d1d4f670b | 415 | py | Python | packages/setup.py | TheWorldOfCode/MWS | 7a8b7dbc88e80880f0fa9bfa895a624ab11f4093 | [
"BSD-3-Clause"
] | null | null | null | packages/setup.py | TheWorldOfCode/MWS | 7a8b7dbc88e80880f0fa9bfa895a624ab11f4093 | [
"BSD-3-Clause"
] | null | null | null | packages/setup.py | TheWorldOfCode/MWS | 7a8b7dbc88e80880f0fa9bfa895a624ab11f4093 | [
"BSD-3-Clause"
] | null | null | null |
from setuptools import setup
setup(name='mws',
version='0.2',
description='Multi window sender',
url='https://github.com/TheWorldOfCode/MWS',
author='TheWorldOfCode',
author_email='dannj75@gmail.com',
install_requires=[
"python-daemon>=2.2.4",
"python-xlib>=0.27... | 24.411765 | 50 | 0.561446 |
from setuptools import setup
setup(name='mws',
version='0.2',
description='Multi window sender',
url='https://github.com/TheWorldOfCode/MWS',
author='TheWorldOfCode',
author_email='dannj75@gmail.com',
install_requires=[
"python-daemon>=2.2.4",
"python-xlib>=0.27... | true | true |
79087d5ebdcbd6a611a5a6f3ef36637a0d631622 | 28,709 | py | Python | latex2sympy.py | ConsoleBit/latex2sympy | 88eb1e0a42beb62c41601c9d5154253c3e712a8d | [
"MIT"
] | null | null | null | latex2sympy.py | ConsoleBit/latex2sympy | 88eb1e0a42beb62c41601c9d5154253c3e712a8d | [
"MIT"
] | null | null | null | latex2sympy.py | ConsoleBit/latex2sympy | 88eb1e0a42beb62c41601c9d5154253c3e712a8d | [
"MIT"
] | null | null | null | import sympy
import antlr4
from antlr4.error.ErrorListener import ErrorListener
from sympy.core.operations import AssocOp
try:
from gen.PSParser import PSParser
from gen.PSLexer import PSLexer
from gen.PSListener import PSListener
except Exception:
from .gen.PSParser import PSParser
from .gen.PSLex... | 33.15127 | 99 | 0.571633 | import sympy
import antlr4
from antlr4.error.ErrorListener import ErrorListener
from sympy.core.operations import AssocOp
try:
from gen.PSParser import PSParser
from gen.PSLexer import PSLexer
from gen.PSListener import PSListener
except Exception:
from .gen.PSParser import PSParser
from .gen.PSLex... | true | true |
79088056be0dcfbcb88134be5d64cd1a09c92800 | 1,580 | py | Python | python-news_aggregator/migrations/versions/20180830_cluster_control.py | hanakhry/Crime_Admin | 17f96a81b80fb1302fb7b00f57bc88412d131675 | [
"MIT"
] | null | null | null | python-news_aggregator/migrations/versions/20180830_cluster_control.py | hanakhry/Crime_Admin | 17f96a81b80fb1302fb7b00f57bc88412d131675 | [
"MIT"
] | null | null | null | python-news_aggregator/migrations/versions/20180830_cluster_control.py | hanakhry/Crime_Admin | 17f96a81b80fb1302fb7b00f57bc88412d131675 | [
"MIT"
] | null | null | null | """adding cluster control options on every level
Revision ID: a987c6ce888d
Revises: 00c5cc87408d
Create Date: 2018-08-01 18:34:00.415937
"""
import logging
from alembic import op
import sqlalchemy as sa
revision = 'a987c6ce888d'
down_revision = '8079a1cb5874'
branch_labels = None
depends_on = None
logger = logging.g... | 35.111111 | 78 | 0.643038 | import logging
from alembic import op
import sqlalchemy as sa
revision = 'a987c6ce888d'
down_revision = '8079a1cb5874'
branch_labels = None
depends_on = None
logger = logging.getLogger('alembic.' + revision)
CLUSTER_CONF_OPTIONS = ['cluster_enabled', 'cluster_tfidf_enabled',
'cluster_same_categ... | true | true |
79088058ffbe478e046e84e2d58d137d99fc4250 | 10,587 | py | Python | src/abaqus/Step/AnnealStep.py | Haiiliin/PyAbaqus | f20db6ebea19b73059fe875a53be370253381078 | [
"MIT"
] | 7 | 2022-01-21T09:15:45.000Z | 2022-02-15T09:31:58.000Z | src/abaqus/Step/AnnealStep.py | Haiiliin/PyAbaqus | f20db6ebea19b73059fe875a53be370253381078 | [
"MIT"
] | null | null | null | src/abaqus/Step/AnnealStep.py | Haiiliin/PyAbaqus | f20db6ebea19b73059fe875a53be370253381078 | [
"MIT"
] | null | null | null | from abaqusConstants import *
from .AnalysisStep import AnalysisStep
from ..Adaptivity.AdaptiveMeshConstraintState import AdaptiveMeshConstraintState
from ..Adaptivity.AdaptiveMeshDomain import AdaptiveMeshDomain
from ..BoundaryCondition.BoundaryConditionState import BoundaryConditionState
from ..Load.LoadCase import L... | 39.066421 | 119 | 0.694248 | from abaqusConstants import *
from .AnalysisStep import AnalysisStep
from ..Adaptivity.AdaptiveMeshConstraintState import AdaptiveMeshConstraintState
from ..Adaptivity.AdaptiveMeshDomain import AdaptiveMeshDomain
from ..BoundaryCondition.BoundaryConditionState import BoundaryConditionState
from ..Load.LoadCase import L... | true | true |
79088095e8c2af441dce842e8978848873eb522b | 88 | py | Python | The Noble Houses of Apaxia/noble.py | nithinmanne/kattis | 70cb32fb8c1010168b8a4101bd73bd74db2a087d | [
"BSD-3-Clause"
] | null | null | null | The Noble Houses of Apaxia/noble.py | nithinmanne/kattis | 70cb32fb8c1010168b8a4101bd73bd74db2a087d | [
"BSD-3-Clause"
] | null | null | null | The Noble Houses of Apaxia/noble.py | nithinmanne/kattis | 70cb32fb8c1010168b8a4101bd73bd74db2a087d | [
"BSD-3-Clause"
] | null | null | null | name = input().split()
print(name[0], name[1]*(len(name[1]) if len(name[1])!=5 else 4)) | 44 | 64 | 0.602273 | name = input().split()
print(name[0], name[1]*(len(name[1]) if len(name[1])!=5 else 4)) | true | true |
790880c86cb38747484b688f807153decbae4756 | 1,860 | py | Python | exercizes/ur5_conf.py | NimaPng/tsid | 23bbc6bace4f4623c2189535e71ba63bedbc4368 | [
"BSD-2-Clause"
] | null | null | null | exercizes/ur5_conf.py | NimaPng/tsid | 23bbc6bace4f4623c2189535e71ba63bedbc4368 | [
"BSD-2-Clause"
] | null | null | null | exercizes/ur5_conf.py | NimaPng/tsid | 23bbc6bace4f4623c2189535e71ba63bedbc4368 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 18 09:47:07 2019
@author: student
"""
import numpy as np
import os
np.set_printoptions(precision=3, linewidth=200, suppress=True)
LINE_WIDTH = 60
N_SIMULATION = 4000 # number of time steps simulated
dt = 0.002 # controller time step
q0 ... | 37.2 | 157 | 0.626882 |
import numpy as np
import os
np.set_printoptions(precision=3, linewidth=200, suppress=True)
LINE_WIDTH = 60
N_SIMULATION = 4000
dt = 0.002
q0 = np.array([ 0. , -1.0, 0.7, 0. , 0. , 0. ])
amp = np.array([0*0.02, 0.1, 0.10])
phi =... | true | true |
79088261082774e4ab99fa5b9dbbf114d5a65826 | 5,073 | py | Python | moneyforecast/tests/records/fixtures.py | curaloucura/money-forecast | b6032028106772526a96c3329c8af66f9b9d0930 | [
"Unlicense"
] | 7 | 2015-02-01T21:44:23.000Z | 2021-04-19T07:45:06.000Z | moneyforecast/tests/records/fixtures.py | curaloucura/money-forecast | b6032028106772526a96c3329c8af66f9b9d0930 | [
"Unlicense"
] | null | null | null | moneyforecast/tests/records/fixtures.py | curaloucura/money-forecast | b6032028106772526a96c3329c8af66f9b9d0930 | [
"Unlicense"
] | 4 | 2015-06-27T15:05:06.000Z | 2020-06-14T05:14:43.000Z | import pytest
from datetime import date, datetime
from dateutil.relativedelta import relativedelta
from django.contrib.auth.models import User
from records.models import (
Category, Record, Budget, OUTCOME, INCOME, SAVINGS, tmz)
from records.month_control import MonthControl, MonthControlWithBudget
@pytest.fixt... | 24.389423 | 78 | 0.723044 | import pytest
from datetime import date, datetime
from dateutil.relativedelta import relativedelta
from django.contrib.auth.models import User
from records.models import (
Category, Record, Budget, OUTCOME, INCOME, SAVINGS, tmz)
from records.month_control import MonthControl, MonthControlWithBudget
@pytest.fixt... | true | true |
790882ca2f71e387f57bad9561d8c48b85ea3f06 | 14,031 | py | Python | pyregion/mpl_helper.py | keflavich/pyregion | 1ed46731eedffcb52910b0574b2a4e7a8cc99a7d | [
"MIT"
] | null | null | null | pyregion/mpl_helper.py | keflavich/pyregion | 1ed46731eedffcb52910b0574b2a4e7a8cc99a7d | [
"MIT"
] | null | null | null | pyregion/mpl_helper.py | keflavich/pyregion | 1ed46731eedffcb52910b0574b2a4e7a8cc99a7d | [
"MIT"
] | null | null | null | import copy
import numpy as np
from math import cos, sin, pi, atan2
import warnings
import matplotlib.patches as mpatches
from matplotlib.path import Path
from matplotlib.lines import Line2D
from matplotlib.transforms import Affine2D, Bbox, IdentityTransform
from matplotlib.text import Annotation
def rotated_polygon(... | 36.069409 | 93 | 0.480721 | import copy
import numpy as np
from math import cos, sin, pi, atan2
import warnings
import matplotlib.patches as mpatches
from matplotlib.path import Path
from matplotlib.lines import Line2D
from matplotlib.transforms import Affine2D, Bbox, IdentityTransform
from matplotlib.text import Annotation
def rotated_polygon(... | true | true |
79088521341c908e9acfbace2f7914850759e997 | 3,642 | py | Python | code_examples/tensorflow/kernel_benchmarks/dense.py | Splendon/examples | ed4a8a01857b6ddca49559141acf5d0986eb01e1 | [
"MIT"
] | null | null | null | code_examples/tensorflow/kernel_benchmarks/dense.py | Splendon/examples | ed4a8a01857b6ddca49559141acf5d0986eb01e1 | [
"MIT"
] | null | null | null | code_examples/tensorflow/kernel_benchmarks/dense.py | Splendon/examples | ed4a8a01857b6ddca49559141acf5d0986eb01e1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Benchmark a single Dense layer with no host/device data transfers.
The Items/sec reported at the end of the benchmark is based on wall time.
Run with -h or --help for options.
"""
import inspect
import os
import sys
import tensorflow as tf
from tensorflow.python.ipu import utils
def dense(... | 33.109091 | 87 | 0.635365 |
import inspect
import os
import sys
import tensorflow as tf
from tensorflow.python.ipu import utils
def dense(opts, inputs):
if opts.activation:
return tf.layers.dense(units=opts.size, inputs=inputs, activation=tf.nn.relu)
else:
return tf.layers.dense(units=opts.size, inputs=inputs)
d... | true | true |
7908855d61873f2dcaabb241bac1d57344c71570 | 7,430 | py | Python | demo/search/src/eval/evaluation.py | meta-soul/MetaSpore | e6fbc12c6a3139df76c87215b16f9dba65962ec7 | [
"Apache-2.0"
] | 32 | 2022-03-30T10:24:00.000Z | 2022-03-31T16:19:15.000Z | demo/search/src/eval/evaluation.py | meta-soul/MetaSpore | e6fbc12c6a3139df76c87215b16f9dba65962ec7 | [
"Apache-2.0"
] | null | null | null | demo/search/src/eval/evaluation.py | meta-soul/MetaSpore | e6fbc12c6a3139df76c87215b16f9dba65962ec7 | [
"Apache-2.0"
] | 3 | 2022-03-30T10:28:57.000Z | 2022-03-30T11:37:39.000Z | #
# Copyright 2022 DMetaSoul
#
# 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 writin... | 37.715736 | 161 | 0.689367 |
import sys
import json
from collections import Counter
MaxMRRRank = 10
def load_reference_from_stream(f):
qids_to_relevant_passageids = {}
for line in f:
try:
sample = json.loads(line.strip())
qid = sample["question_id"]
if qid in qids_to_relevant_pa... | true | true |
790886c21871b8643b6ad7fb41cd85f3c4945fd1 | 23,928 | py | Python | tests/test_hgvs_transcriptmapper.py | jmuhlich/hgvs | 26aba8877791b0f94f1e14a5a49c60bcdaf2e6fd | [
"Apache-2.0"
] | null | null | null | tests/test_hgvs_transcriptmapper.py | jmuhlich/hgvs | 26aba8877791b0f94f1e14a5a49c60bcdaf2e6fd | [
"Apache-2.0"
] | null | null | null | tests/test_hgvs_transcriptmapper.py | jmuhlich/hgvs | 26aba8877791b0f94f1e14a5a49c60bcdaf2e6fd | [
"Apache-2.0"
] | 3 | 2016-08-08T03:04:37.000Z | 2020-01-16T08:56:16.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import unittest
from nose.plugins.attrib import attr
import hgvs.dataproviders.uta
import hgvs.location
import hgvs.parser
from hgvs.exceptions import HGVSError
from hgvs.transcriptmapper import TranscriptMapp... | 68.365714 | 159 | 0.546974 |
from __future__ import absolute_import, division, print_function, unicode_literals
import unittest
from nose.plugins.attrib import attr
import hgvs.dataproviders.uta
import hgvs.location
import hgvs.parser
from hgvs.exceptions import HGVSError
from hgvs.transcriptmapper import TranscriptMapper
@attr(tags=["quick"... | true | true |
790887059b23bb6f3d43ae788a4f4730e1f1fcc2 | 345 | py | Python | wxcloudrun/np_test/views.py | nixiaopan/nipan | 4e57e7f25089bae64a233c2e3ba49b703147183e | [
"MIT"
] | null | null | null | wxcloudrun/np_test/views.py | nixiaopan/nipan | 4e57e7f25089bae64a233c2e3ba49b703147183e | [
"MIT"
] | null | null | null | wxcloudrun/np_test/views.py | nixiaopan/nipan | 4e57e7f25089bae64a233c2e3ba49b703147183e | [
"MIT"
] | null | null | null | import json
import logging
from django.http import JsonResponse
logger = logging.getLogger('log')
from wxcloudrun.utils.SQL.DBUtils import DBUtils
def test1(request):
print(request.headers)
logger.info(request.headers)
rsp = JsonResponse({'code': 0, 'errorMsg': '😁'}, json_dumps_params={'ensure_ascii':... | 19.166667 | 95 | 0.727536 | import json
import logging
from django.http import JsonResponse
logger = logging.getLogger('log')
from wxcloudrun.utils.SQL.DBUtils import DBUtils
def test1(request):
print(request.headers)
logger.info(request.headers)
rsp = JsonResponse({'code': 0, 'errorMsg': '😁'}, json_dumps_params={'ensure_ascii':... | true | true |
790887e7d19242e1bf1bd1d30f8c3fd2df502ebb | 3,401 | py | Python | api_drf/api_drf/settings.py | kaparis/spa101 | 0c225d0676a13a33950aca5954c02b443237149d | [
"MIT"
] | null | null | null | api_drf/api_drf/settings.py | kaparis/spa101 | 0c225d0676a13a33950aca5954c02b443237149d | [
"MIT"
] | null | null | null | api_drf/api_drf/settings.py | kaparis/spa101 | 0c225d0676a13a33950aca5954c02b443237149d | [
"MIT"
] | null | null | null | """
Django settings for api_drf project.
Generated by 'django-admin startproject' using Django 2.1.7.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
#... | 26.570313 | 91 | 0.701558 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '2p$!i%#w$3e9(l3v4#%_#fi2_fae2l7ksdsd+1*vrc6_#8_@_*'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
790887ffc8dffa14b3b055c2b6f737bcef1c3d66 | 318 | py | Python | src/accounts/migrations/0002_remove_user_is_donor.py | paceite/Seelife---An-NGO-Website | 02e6b5ec94d9a76079eccde54b3cd40b9e979def | [
"MIT"
] | null | null | null | src/accounts/migrations/0002_remove_user_is_donor.py | paceite/Seelife---An-NGO-Website | 02e6b5ec94d9a76079eccde54b3cd40b9e979def | [
"MIT"
] | null | null | null | src/accounts/migrations/0002_remove_user_is_donor.py | paceite/Seelife---An-NGO-Website | 02e6b5ec94d9a76079eccde54b3cd40b9e979def | [
"MIT"
] | null | null | null | # Generated by Django 2.1.7 on 2019-03-16 10:46
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='user',
name='is_donor',
),
]
| 17.666667 | 47 | 0.578616 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='user',
name='is_donor',
),
]
| true | true |
7908880a1e3fcb6c65a2a2b3e8d276dba81fcf74 | 1,185 | py | Python | Python/questions/WordLadder/word-ladder.py | udcymen/leetcode | 7c7c4085e6a8cea7106dd8bca86b370ca53e3ddd | [
"MIT"
] | null | null | null | Python/questions/WordLadder/word-ladder.py | udcymen/leetcode | 7c7c4085e6a8cea7106dd8bca86b370ca53e3ddd | [
"MIT"
] | null | null | null | Python/questions/WordLadder/word-ladder.py | udcymen/leetcode | 7c7c4085e6a8cea7106dd8bca86b370ca53e3ddd | [
"MIT"
] | null | null | null | class Solution:
def ladderLength(self, beginWord: str, endWord: str, wordList: List[str]) -> int:
if endWord not in wordList:
return 0
result = 0
l = len(beginWord)
beginSet = {beginWord}
endSet = {endWord}
wordList = set(wordList)
... | 32.027027 | 85 | 0.389873 | class Solution:
def ladderLength(self, beginWord: str, endWord: str, wordList: List[str]) -> int:
if endWord not in wordList:
return 0
result = 0
l = len(beginWord)
beginSet = {beginWord}
endSet = {endWord}
wordList = set(wordList)
... | true | true |
790888a73bee43f4c8f7b5ae9835d1dbf78874a1 | 32,113 | py | Python | dev/html2text.py | sceniclife/arlo | edbd17fb8ab60b1d5d36354c52f4ddb0966a9514 | [
"Apache-2.0"
] | null | null | null | dev/html2text.py | sceniclife/arlo | edbd17fb8ab60b1d5d36354c52f4ddb0966a9514 | [
"Apache-2.0"
] | null | null | null | dev/html2text.py | sceniclife/arlo | edbd17fb8ab60b1d5d36354c52f4ddb0966a9514 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""html2text: Turn HTML into equivalent Markdown-structured text."""
__version__ = "3.200.3"
__author__ = "Aaron Swartz (me@aaronsw.com)"
__copyright__ = "(C) 2004-2008 Aaron Swartz. GNU GPL 3."
__contributors__ = ["Martin 'Joey' Schulze", "Ricardo Reyes", "Kevin Jay North"]
# TODO:
# Support d... | 35.096175 | 129 | 0.53128 |
__version__ = "3.200.3"
__author__ = "Aaron Swartz (me@aaronsw.com)"
__copyright__ = "(C) 2004-2008 Aaron Swartz. GNU GPL 3."
__contributors__ = ["Martin 'Joey' Schulze", "Ricardo Reyes", "Kevin Jay North"]
try:
True
except NameError:
setattr(__builtins__, 'True', 1)
setattr(__builtins__, 'False', 0)
... | true | true |
790888c89dd43e43cdc2dafb433b71dd44131ea8 | 4,405 | py | Python | setup.py | upstream-janitor/dulwich | a92ab5e826872ddac1cbd72fa1b6a41fe08c6834 | [
"Apache-2.0"
] | null | null | null | setup.py | upstream-janitor/dulwich | a92ab5e826872ddac1cbd72fa1b6a41fe08c6834 | [
"Apache-2.0"
] | null | null | null | setup.py | upstream-janitor/dulwich | a92ab5e826872ddac1cbd72fa1b6a41fe08c6834 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# encoding: utf-8
# Setup file for dulwich
# Copyright (C) 2008-2016 Jelmer Vernooij <jelmer@jelmer.uk>
try:
from setuptools import setup, Extension
except ImportError:
from distutils.core import setup, Extension
has_setuptools = False
else:
has_setuptools = True
from distutils.core i... | 32.153285 | 75 | 0.620204 |
try:
from setuptools import setup, Extension
except ImportError:
from distutils.core import setup, Extension
has_setuptools = False
else:
has_setuptools = True
from distutils.core import Distribution
import io
import os
import sys
from typing import Dict, Any
if sys.version_info < (3, 6):
rai... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.