hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
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 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f72baab36e3a21c7ba43e643724c016ec8ee0837 | 8,858 | py | Python | cinder/openstack/common/config/generator.py | sombrafam/cinder | 60ffb0eedf41b56f3c6af5b301400ced95762194 | [
"Apache-2.0"
] | null | null | null | cinder/openstack/common/config/generator.py | sombrafam/cinder | 60ffb0eedf41b56f3c6af5b301400ced95762194 | [
"Apache-2.0"
] | null | null | null | cinder/openstack/common/config/generator.py | sombrafam/cinder | 60ffb0eedf41b56f3c6af5b301400ced95762194 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 SINA Corporation
# 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... | 32.929368 | 79 | 0.593362 |
from __future__ import print_function
import imp
import os
import re
import socket
import sys
import textwrap
from oslo.config import cfg
import six
from cinder.openstack.common import gettextutils
from cinder.openstack.common import importutils
gettextutils.install('cinder')
STROPT = "StrOpt"
BOOLOPT = "BoolOpt... | true | true |
f72bab7ab1bca3789121e05f9da664664eeab617 | 3,732 | py | Python | GitHubUploader.py | ytyaru/GitHub.Uploader.AddFunction.Contributions.201705141424 | 06e44308b0eb132f0ce1e547cedc6b0f6e566c93 | [
"CC0-1.0"
] | null | null | null | GitHubUploader.py | ytyaru/GitHub.Uploader.AddFunction.Contributions.201705141424 | 06e44308b0eb132f0ce1e547cedc6b0f6e566c93 | [
"CC0-1.0"
] | null | null | null | GitHubUploader.py | ytyaru/GitHub.Uploader.AddFunction.Contributions.201705141424 | 06e44308b0eb132f0ce1e547cedc6b0f6e566c93 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/python3
#!python3
#encoding:utf-8
import sys
import os.path
import subprocess
import configparser
import argparse
import web.service.github.api.v3.AuthenticationsCreator
import web.service.github.api.v3.AuthenticationData
#import web.service.github.api.v3.CurrentUser
import web.service.github.api.v3.CurrentR... | 42.409091 | 159 | 0.665327 | import sys
import os.path
import subprocess
import configparser
import argparse
import web.service.github.api.v3.AuthenticationsCreator
import web.service.github.api.v3.AuthenticationData
import web.service.github.api.v3.CurrentRepository
import web.service.github.api.v3.Client
import database.src.Database
import cui.u... | true | true |
f72bac46a7bf89e92fd86af932bfe8a7135e61d2 | 13,197 | py | Python | src/sardana/util/funcgenerator.py | schooft/sardana | 76287b416650f40da79871ee3849340d0ff31f1d | [
"CC-BY-3.0"
] | null | null | null | src/sardana/util/funcgenerator.py | schooft/sardana | 76287b416650f40da79871ee3849340d0ff31f1d | [
"CC-BY-3.0"
] | null | null | null | src/sardana/util/funcgenerator.py | schooft/sardana | 76287b416650f40da79871ee3849340d0ff31f1d | [
"CC-BY-3.0"
] | null | null | null | ##############################################################################
##
# This file is part of Sardana
##
# http://www.sardana-controls.org/
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Sardana is free software: you can redistribute it and/or modify
# it under the terms of the GNU Less... | 35.286096 | 79 | 0.608169 |
import time
import threading
import math
import copy
import numpy
import traceback
from sardana import State
from sardana.sardanaevent import EventGenerator, EventType
from sardana.pool.pooldefs import SynchParam, SynchDomain
from taurus.core.util.log import Logger
def strictly_increasing(l):
return all(x < y f... | true | true |
f72bac8581667e7935b4584979b404c4fdca5866 | 468 | py | Python | examples/trap.py | fthyssen/aiosnmp | 667a166214e2e70c333510a6d24208dd772a1f26 | [
"MIT"
] | null | null | null | examples/trap.py | fthyssen/aiosnmp | 667a166214e2e70c333510a6d24208dd772a1f26 | [
"MIT"
] | null | null | null | examples/trap.py | fthyssen/aiosnmp | 667a166214e2e70c333510a6d24208dd772a1f26 | [
"MIT"
] | null | null | null | import asyncio
import aiosnmp
async def handler(host: str, port: int, message: aiosnmp.SnmpV2TrapMessage) -> None:
print(f"got packet from {host}:{port}")
for d in message.data.varbinds:
print(f"oid: {d.oid}, value: {d.value}")
async def main():
p = aiosnmp.SnmpV2TrapServer(
host="127.0... | 22.285714 | 84 | 0.662393 | import asyncio
import aiosnmp
async def handler(host: str, port: int, message: aiosnmp.SnmpV2TrapMessage) -> None:
print(f"got packet from {host}:{port}")
for d in message.data.varbinds:
print(f"oid: {d.oid}, value: {d.value}")
async def main():
p = aiosnmp.SnmpV2TrapServer(
host="127.0... | true | true |
f72bacd78c4c106ed1626a1724d718b3f8d317dc | 481 | py | Python | _unittests/ut_plotting/test_dummy.py | sdpython/manyapi | dc2aadc58a5d72904f95424dbe57bb832d3ccd73 | [
"MIT"
] | 1 | 2020-08-08T13:38:45.000Z | 2020-08-08T13:38:45.000Z | _unittests/ut_plotting/test_dummy.py | sdpython/manyapi | dc2aadc58a5d72904f95424dbe57bb832d3ccd73 | [
"MIT"
] | 8 | 2018-05-05T10:03:04.000Z | 2019-06-08T10:21:30.000Z | _unittests/ut_plotting/test_dummy.py | sdpython/manyapi | dc2aadc58a5d72904f95424dbe57bb832d3ccd73 | [
"MIT"
] | null | null | null | """
@brief test log(time=13s)
"""
import unittest
from pyquickhelper.pycode import ExtTestCase
from manydataapi.plotting import plot_aggregated_ts, daily_timeseries
class TestDummm(ExtTestCase):
def test_agg_raise(self):
df = daily_timeseries()
from matplotlib import pyplot as plt
_... | 21.863636 | 69 | 0.675676 | import unittest
from pyquickhelper.pycode import ExtTestCase
from manydataapi.plotting import plot_aggregated_ts, daily_timeseries
class TestDummm(ExtTestCase):
def test_agg_raise(self):
df = daily_timeseries()
from matplotlib import pyplot as plt
_, ax = plt.subplots(1, 1)
plot_... | true | true |
f72bacee48dd612bab37d2f97351e60521569498 | 6,673 | py | Python | tests/test_lammps_cycle.py | irisTa56/ease4lmp | 0ad69632fbe0d8c2a55e58af13efd7be1d566394 | [
"MIT"
] | null | null | null | tests/test_lammps_cycle.py | irisTa56/ease4lmp | 0ad69632fbe0d8c2a55e58af13efd7be1d566394 | [
"MIT"
] | 2 | 2019-03-06T04:33:27.000Z | 2019-07-27T08:30:28.000Z | tests/test_lammps_cycle.py | irisTa56/ease4lmp | 0ad69632fbe0d8c2a55e58af13efd7be1d566394 | [
"MIT"
] | null | null | null | import unittest
from ease4lmp import (
BondedAtoms, LammpsWriter,
create_atoms_from_data, create_atoms_from_molecule)
from ase.build import bulk, molecule
import numpy as np
import os
import itertools
def write_files(atoms):
writer = LammpsWriter(atoms, atom_style="molecular")
writer.set_atom_data(mol=[0... | 30.47032 | 76 | 0.683051 | import unittest
from ease4lmp import (
BondedAtoms, LammpsWriter,
create_atoms_from_data, create_atoms_from_molecule)
from ase.build import bulk, molecule
import numpy as np
import os
import itertools
def write_files(atoms):
writer = LammpsWriter(atoms, atom_style="molecular")
writer.set_atom_data(mol=[0... | true | true |
f72bacff2befd45529dc6156485e5eaa617d18a2 | 611 | py | Python | api/models/post_rank/migrations/0001_initial.py | eggmoid/GalleryManage-FastAPI | fa50cef623a03aed2d7b4ac9c76d74cfb9d898eb | [
"MIT"
] | null | null | null | api/models/post_rank/migrations/0001_initial.py | eggmoid/GalleryManage-FastAPI | fa50cef623a03aed2d7b4ac9c76d74cfb9d898eb | [
"MIT"
] | 6 | 2021-08-06T16:30:03.000Z | 2021-12-11T05:30:02.000Z | api/models/post_rank/migrations/0001_initial.py | eggmoid/GalleryManage-FastAPI | fa50cef623a03aed2d7b4ac9c76d74cfb9d898eb | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2021-08-25 04:03
from django.db import migrations
class Migration(migrations.Migration):
initial = True
dependencies = [
('post', '0005_alter_post_options'),
]
operations = [
migrations.CreateModel(
name='PostRank',
fields=[
... | 21.068966 | 49 | 0.464812 |
from django.db import migrations
class Migration(migrations.Migration):
initial = True
dependencies = [
('post', '0005_alter_post_options'),
]
operations = [
migrations.CreateModel(
name='PostRank',
fields=[
],
options={
... | true | true |
f72bad3d0b4002ad1cb2fcc9489978b3fa4f88bf | 3,577 | py | Python | checkers/utils.py | gbravoi/monte-carlo-tree-search | 578df8df925e5f569e7354daff6642e1781389b6 | [
"MIT"
] | null | null | null | checkers/utils.py | gbravoi/monte-carlo-tree-search | 578df8df925e5f569e7354daff6642e1781389b6 | [
"MIT"
] | null | null | null | checkers/utils.py | gbravoi/monte-carlo-tree-search | 578df8df925e5f569e7354daff6642e1781389b6 | [
"MIT"
] | null | null | null | """
Martin Kersner, m.kersner@gmail.com
seoulai.com
2018
Adapted by Gabriela B. to work with python 2.7 and ROS
"""
import random
import numpy as np
from base import Constants
from rules import Rules
class BoardEncoding(object):
def __init__(self):
self._constants = Constants()
self._encoding ... | 26.496296 | 100 | 0.632933 | import random
import numpy as np
from base import Constants
from rules import Rules
class BoardEncoding(object):
def __init__(self):
self._constants = Constants()
self._encoding = {}
self.empty = 0
self.dark = 20
self.dark_king = 21
self.light = 10
self.... | true | true |
f72bad4faefc64d772b991b54a1874f2f71d5c3b | 1,267 | py | Python | modules/AppTheme.py | Fa1c0n35/RootTheBoxs | 4f2a9886c8eedca3039604b93929c8c09866115e | [
"Apache-2.0"
] | 1 | 2019-06-29T08:40:54.000Z | 2019-06-29T08:40:54.000Z | modules/AppTheme.py | Fa1c0n35/RootTheBoxs | 4f2a9886c8eedca3039604b93929c8c09866115e | [
"Apache-2.0"
] | null | null | null | modules/AppTheme.py | Fa1c0n35/RootTheBoxs | 4f2a9886c8eedca3039604b93929c8c09866115e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mar 14, 2012
@author: moloch
Copyright 2012 Root the Box
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/licen... | 30.902439 | 85 | 0.697711 |
from tornado.web import UIModule
from tornado.options import options
from models.Theme import Theme
class AppTheme(UIModule):
theme = Theme.by_name(options.default_theme)
def render(self, *args, **kwargs):
if options.allow_user_to_change_theme and (self.handler.session is not None):
r... | true | true |
f72bad64f0a9f77a3272ef388210f662dc6820c7 | 749 | py | Python | smbl/prog/plugins/picard.py | karel-brinda/snakemake-lib | 5922fa2fc4060d86172e991361a1cceb0af51af8 | [
"MIT"
] | 26 | 2015-03-16T03:37:02.000Z | 2021-01-18T17:34:16.000Z | smbl/prog/plugins/picard.py | karel-brinda/smbl | 5922fa2fc4060d86172e991361a1cceb0af51af8 | [
"MIT"
] | 12 | 2015-02-05T10:57:16.000Z | 2016-06-07T18:09:57.000Z | smbl/prog/plugins/picard.py | karel-brinda/snakemake-lib | 5922fa2fc4060d86172e991361a1cceb0af51af8 | [
"MIT"
] | 6 | 2015-06-03T20:06:49.000Z | 2020-12-13T09:48:03.000Z | import smbl
import snakemake
import os
from ._program import *
PICARD = get_bin_file_path("picard.jar")
##########################################
##########################################
class Picard(Program):
@classmethod
def get_installation_files(cls):
return [
PICARD,
]
@cl... | 23.40625 | 143 | 0.599466 | import smbl
import snakemake
import os
from ._program import *
PICARD = get_bin_file_path("picard.jar")
class Picard(Program):
@classmethod
def get_installation_files(cls):
return [
PICARD,
]
@classmethod
def install(cls):
ver="1.140"
fn=cls.download_file("https://github.com... | true | true |
f72badcfec08b1a7904807f002fbd7e59e89878d | 2,519 | py | Python | ckan/tests/cli/test_config_tool.py | jbrown-xentity/ckan | ecd9ac6bc6cfb5bb4fcbec82c431f4564ef649ed | [
"BSD-3-Clause"
] | 2,805 | 2015-01-02T18:13:15.000Z | 2022-03-31T03:35:01.000Z | ckan/tests/cli/test_config_tool.py | jbrown-xentity/ckan | ecd9ac6bc6cfb5bb4fcbec82c431f4564ef649ed | [
"BSD-3-Clause"
] | 3,801 | 2015-01-02T11:05:36.000Z | 2022-03-31T19:24:37.000Z | ckan/tests/cli/test_config_tool.py | jbrown-xentity/ckan | ecd9ac6bc6cfb5bb4fcbec82c431f4564ef649ed | [
"BSD-3-Clause"
] | 1,689 | 2015-01-02T19:46:43.000Z | 2022-03-28T14:59:43.000Z | # -*- coding: utf-8 -*-
import os
import pytest
from ckan.cli.cli import ckan
from configparser import ConfigParser, NoOptionError
@pytest.fixture
def config_file(tmp_path):
dest = tmp_path / u'config.ini'
tpl = os.path.join(
os.path.dirname(__file__),
u'templates/config_tool.ini.tpl')
wi... | 29.988095 | 76 | 0.653831 |
import os
import pytest
from ckan.cli.cli import ckan
from configparser import ConfigParser, NoOptionError
@pytest.fixture
def config_file(tmp_path):
dest = tmp_path / u'config.ini'
tpl = os.path.join(
os.path.dirname(__file__),
u'templates/config_tool.ini.tpl')
with open(tpl, u'rb') as d... | true | true |
f72badfdcc7c9b8294a786b553d4648ee517ad6c | 12,634 | py | Python | tests/python/pants_test/util/test_contextutil.py | ghthor/pants | 450de702414f87f563081ddefaefd8a554de07a3 | [
"Apache-2.0"
] | null | null | null | tests/python/pants_test/util/test_contextutil.py | ghthor/pants | 450de702414f87f563081ddefaefd8a554de07a3 | [
"Apache-2.0"
] | null | null | null | tests/python/pants_test/util/test_contextutil.py | ghthor/pants | 450de702414f87f563081ddefaefd8a554de07a3 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import pstats
import shutil
import signal
import sys
import unittest
import uui... | 37.93994 | 100 | 0.679516 |
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import pstats
import shutil
import signal
import sys
import unittest
import uuid
import zipfile
from builtins import next, object, range, str
from contextlib import contextmanager
import mock
from pants.util.contextutil imp... | true | true |
f72bae6a1e0213eb229c54b75687299a18759829 | 1,090 | py | Python | IntroProPython/aula10-poo/ex10_9.py | SweydAbdul/estudos-python | b052708d0566a0afb9a1c04d035467d45f820879 | [
"MIT"
] | null | null | null | IntroProPython/aula10-poo/ex10_9.py | SweydAbdul/estudos-python | b052708d0566a0afb9a1c04d035467d45f820879 | [
"MIT"
] | null | null | null | IntroProPython/aula10-poo/ex10_9.py | SweydAbdul/estudos-python | b052708d0566a0afb9a1c04d035467d45f820879 | [
"MIT"
] | null | null | null | #Nilo soluction
class Estado:
def __init__(self, nome, sigla):
self.nome = nome
self.sigla = sigla
self.cidades = []
def adiciona_cidades(self, cidade):
cidade.estado = self
self.cidades.append(cidade)
def populacao(self):
return sum([c.populacao for c in s... | 28.684211 | 72 | 0.655963 |
class Estado:
def __init__(self, nome, sigla):
self.nome = nome
self.sigla = sigla
self.cidades = []
def adiciona_cidades(self, cidade):
cidade.estado = self
self.cidades.append(cidade)
def populacao(self):
return sum([c.populacao for c in self.cidades])
c... | true | true |
f72baec4eeaab524e7f16dca567ab548d635f3bb | 3,949 | py | Python | samples/basic/crud/models/cisco-ios-xr/Cisco-IOS-XR-shellutil-oper/nc-read-xr-shellutil-oper-20-ydk.py | maccioni/ydk-py-samples | d1758694bef97327c5477e65649326c7595ce499 | [
"Apache-2.0"
] | 104 | 2016-03-15T17:04:01.000Z | 2021-12-31T06:09:35.000Z | samples/basic/crud/models/cisco-ios-xr/Cisco-IOS-XR-shellutil-oper/nc-read-xr-shellutil-oper-20-ydk.py | https-maxus-github-com/ydk-py-samples | 1ad6cc2b798f358ff835df93d12924df308b85fc | [
"Apache-2.0"
] | 15 | 2016-03-15T23:09:47.000Z | 2020-08-13T12:13:18.000Z | samples/basic/crud/models/cisco-ios-xr/Cisco-IOS-XR-shellutil-oper/nc-read-xr-shellutil-oper-20-ydk.py | https-maxus-github-com/ydk-py-samples | 1ad6cc2b798f358ff835df93d12924df308b85fc | [
"Apache-2.0"
] | 87 | 2016-04-15T16:59:23.000Z | 2021-09-18T18:05:47.000Z | #!/usr/bin/env python
#
# Copyright 2016 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 34.946903 | 78 | 0.622436 |
from argparse import ArgumentParser
from urlparse import urlparse
from ydk.services import CRUDService
from ydk.providers import NetconfServiceProvider
from ydk.models.cisco_ios_xr import Cisco_IOS_XR_shellutil_oper \
as xr_shellutil_oper
import datetime
import textwrap
import logging
def process_system_time(s... | true | true |
f72baf0f5132719036a4523e688ff00bace31589 | 6,130 | py | Python | scrape_mars.py | darrenluc93/web-scraping-challenge | 50a9a21161ab0920038c8e0d6a9390bb8e35c5f5 | [
"ADSL"
] | null | null | null | scrape_mars.py | darrenluc93/web-scraping-challenge | 50a9a21161ab0920038c8e0d6a9390bb8e35c5f5 | [
"ADSL"
] | null | null | null | scrape_mars.py | darrenluc93/web-scraping-challenge | 50a9a21161ab0920038c8e0d6a9390bb8e35c5f5 | [
"ADSL"
] | null | null | null | #Import Libraries
#Web Scraping tools
from bs4 import BeautifulSoup as bs
from selenium import webdriver
#from splinter import Browser
#DataFrame tools
import pandas as pd
#Misc tools for web scraping
import time
import requests
#Function to initianilze browser.
def init_browser():
#Settings for headless mode.... | 29.471154 | 194 | 0.556444 | from bs4 import BeautifulSoup as bs
from selenium import webdriver
import pandas as pd
import time
import requests
def init_browser():
options = webdriver.ChromeOptions()
options.add_argument('headless')
browser = webdriver.Chrome("/usr/local/bin/chromedriver",chrome_options = options)
... | true | true |
f72bb0dfab67291261f8d64decce38b078e31dc2 | 1,812 | py | Python | API/client/python-client-generated/test/test_model_flow_chart_node_component_api.py | zhuofusong/machine-fault-diagnosis | 4c35885e3fbb3c552f526019313a8eae9df28905 | [
"MIT"
] | 2 | 2020-04-30T01:06:55.000Z | 2020-06-08T04:11:28.000Z | API/client/python-client-generated/test/test_model_flow_chart_node_component_api.py | zhuofusong/machine-fault-diagnosis | 4c35885e3fbb3c552f526019313a8eae9df28905 | [
"MIT"
] | 5 | 2020-04-13T14:13:53.000Z | 2021-08-24T17:16:30.000Z | API/client/python-client-generated/test/test_model_flow_chart_node_component_api.py | zhuofusong/machine-fault-diagnosis | 4c35885e3fbb3c552f526019313a8eae9df28905 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Machine fault diagnosis
List of top level server APIs # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import swagger_client
from api.model_flow_chart_node_... | 29.225806 | 105 | 0.734547 |
from __future__ import absolute_import
import unittest
import swagger_client
from api.model_flow_chart_node_component_api import ModelFlowChartNodeComponentApi from swagger_client.rest import ApiException
class TestModelFlowChartNodeComponentApi(unittest.TestCase):
def setUp(self):
self.api = api.mo... | true | true |
f72bb188e19f59d4f42c726c98471832b4cf7c08 | 62 | py | Python | run_ai_api.py | datesann0109/D_2117 | 07a94c65c622cf2aa9f2a852f1f28e647a5823bd | [
"MIT"
] | 1 | 2021-10-19T02:43:30.000Z | 2021-10-19T02:43:30.000Z | run_ai_api.py | datesann0109/D_2117 | 07a94c65c622cf2aa9f2a852f1f28e647a5823bd | [
"MIT"
] | 1 | 2021-10-30T04:46:00.000Z | 2021-10-30T04:46:00.000Z | run_ai_api.py | datesann0109/D_2117 | 07a94c65c622cf2aa9f2a852f1f28e647a5823bd | [
"MIT"
] | 2 | 2021-10-30T22:58:39.000Z | 2021-11-01T10:19:45.000Z | from ai.api import main
if __name__ == "__main__":
main() | 15.5 | 26 | 0.66129 | from ai.api import main
if __name__ == "__main__":
main() | true | true |
f72bb1d1d668b0faf7a48161762de174a03e8bff | 154 | py | Python | Cours-3/Programmes-Python/M3-2.py | Naereen/Introduction-au-Numerique-avec-Python-dpt-DEM-2020 | ee935f67970acbb3c8ba0373f57c21826340c3aa | [
"MIT"
] | 1 | 2020-10-07T19:44:29.000Z | 2020-10-07T19:44:29.000Z | Cours-3/Programmes-Python/M3-2.py | Naereen/Introduction-au-Num-rique-avec-Python-dpt-DEM-2020 | ee935f67970acbb3c8ba0373f57c21826340c3aa | [
"MIT"
] | null | null | null | Cours-3/Programmes-Python/M3-2.py | Naereen/Introduction-au-Num-rique-avec-Python-dpt-DEM-2020 | ee935f67970acbb3c8ba0373f57c21826340c3aa | [
"MIT"
] | null | null | null | somme = 0
n = 5 # valeur quelconque
i = 1
while i <= n:
somme = somme + i
i = i + 1
print("La somme des", n, "premiers entiers est :", somme)
| 19.25 | 57 | 0.558442 | somme = 0
n = 5 i = 1
while i <= n:
somme = somme + i
i = i + 1
print("La somme des", n, "premiers entiers est :", somme)
| true | true |
f72bb320c80fb2f7343a4f0f36be5c6b322a7a94 | 107,134 | py | Python | bigquery/google/cloud/bigquery/job.py | erikwebb/google-cloud-python | 288a878e9a07239015c78a193eca1cc15e926127 | [
"Apache-2.0"
] | 1 | 2019-01-23T21:54:51.000Z | 2019-01-23T21:54:51.000Z | bigquery/google/cloud/bigquery/job.py | erikwebb/google-cloud-python | 288a878e9a07239015c78a193eca1cc15e926127 | [
"Apache-2.0"
] | null | null | null | bigquery/google/cloud/bigquery/job.py | erikwebb/google-cloud-python | 288a878e9a07239015c78a193eca1cc15e926127 | [
"Apache-2.0"
] | 1 | 2020-11-15T11:44:36.000Z | 2020-11-15T11:44:36.000Z | # Copyright 2015 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 34 | 128 | 0.647908 |
import copy
import threading
from six.moves import http_client
import google.api_core.future.polling
from google.cloud import exceptions
from google.cloud.exceptions import NotFound
from google.cloud.bigquery.dataset import DatasetReference
from google.cloud.bigquery.external_config import ExternalConfig
from googl... | true | true |
f72bb4debf4ce516c6fa1d5f7294e9cce53c4b79 | 4,826 | py | Python | cccp/__init__.py | sloev/cccp | 829c359a8607d3f3fb2e1e82f2114bb1c8404ce3 | [
"MIT"
] | 1 | 2020-03-14T11:56:09.000Z | 2020-03-14T11:56:09.000Z | cccp/__init__.py | sloev/cccp | 829c359a8607d3f3fb2e1e82f2114bb1c8404ce3 | [
"MIT"
] | null | null | null | cccp/__init__.py | sloev/cccp | 829c359a8607d3f3fb2e1e82f2114bb1c8404ce3 | [
"MIT"
] | 3 | 2020-03-08T13:23:37.000Z | 2021-12-06T19:46:27.000Z | from string import Template
from dominate.tags import script, link, style
from dominate.util import raw
import json
REQUIRED = [
script(
src="https://unpkg.com/axios@0.19.0/dist/axios.min.js", crossorigin="anonymous"
),
script(
src="https://code.jquery.com/jquery-3.3.1.slim.min.js",
... | 26.371585 | 122 | 0.623291 | from string import Template
from dominate.tags import script, link, style
from dominate.util import raw
import json
REQUIRED = [
script(
src="https://unpkg.com/axios@0.19.0/dist/axios.min.js", crossorigin="anonymous"
),
script(
src="https://code.jquery.com/jquery-3.3.1.slim.min.js",
... | true | true |
f72bb5154ac3efc57f3e05c96a98460ac4436137 | 4,661 | py | Python | lbrynet/core/PaymentRateManager.py | anon4040/lbry | 1f1b34863805f4954fbef3f163ef65268a66771a | [
"MIT"
] | 1 | 2018-12-08T04:42:11.000Z | 2018-12-08T04:42:11.000Z | lbrynet/core/PaymentRateManager.py | mrlucky9/lbry | bf6bc02828ed55e98a3002f487041acbd7841883 | [
"MIT"
] | null | null | null | lbrynet/core/PaymentRateManager.py | mrlucky9/lbry | bf6bc02828ed55e98a3002f487041acbd7841883 | [
"MIT"
] | 1 | 2018-05-01T09:28:52.000Z | 2018-05-01T09:28:52.000Z | from lbrynet.core.Strategy import get_default_strategy, OnlyFreeStrategy
from lbrynet import conf
from decimal import Decimal
class BasePaymentRateManager(object):
def __init__(self, rate=None, info_rate=None):
self.min_blob_data_payment_rate = rate if rate is not None else conf.settings['data_rate']
... | 36.414063 | 98 | 0.679897 | from lbrynet.core.Strategy import get_default_strategy, OnlyFreeStrategy
from lbrynet import conf
from decimal import Decimal
class BasePaymentRateManager(object):
def __init__(self, rate=None, info_rate=None):
self.min_blob_data_payment_rate = rate if rate is not None else conf.settings['data_rate']
... | true | true |
f72bb56ed6f1866f992171ab177c9a2074f78328 | 1,005 | py | Python | cea/examples/extract_reference_case.py | AlexJew/CityEnergyAnalyst | 6eb372c79e5100a2d0abce78561ae368fb409cd1 | [
"MIT"
] | null | null | null | cea/examples/extract_reference_case.py | AlexJew/CityEnergyAnalyst | 6eb372c79e5100a2d0abce78561ae368fb409cd1 | [
"MIT"
] | null | null | null | cea/examples/extract_reference_case.py | AlexJew/CityEnergyAnalyst | 6eb372c79e5100a2d0abce78561ae368fb409cd1 | [
"MIT"
] | null | null | null | """
Extract the reference case (``cea/examples/reference-case-open.zip``).
"""
from __future__ import division
import os
import zipfile
import cea.examples
import cea.config
import cea.inputlocator
# list the sections in the configuration file that are used by this script
# this value is used to generate the help men... | 31.40625 | 99 | 0.758209 | from __future__ import division
import os
import zipfile
import cea.examples
import cea.config
import cea.inputlocator
CEA_CONFIG_SECTIONS = ['extract-reference-case']
def main(config):
reference_case = 'reference-case-{case}.zip'.format(case=config.extract_reference_case.case)
archive = zipfile.ZipFile(os.... | true | true |
f72bb6f0058e6022c5654db644c4f3a8d1350c2a | 18,976 | py | Python | ssd/modeling/backbone/basic.py | Sethan/deeplearning-graphics | ce164847a323d3f07cfe241f4bbed6029777c58d | [
"MIT"
] | null | null | null | ssd/modeling/backbone/basic.py | Sethan/deeplearning-graphics | ce164847a323d3f07cfe241f4bbed6029777c58d | [
"MIT"
] | null | null | null | ssd/modeling/backbone/basic.py | Sethan/deeplearning-graphics | ce164847a323d3f07cfe241f4bbed6029777c58d | [
"MIT"
] | null | null | null | import torch
class BasicModel(torch.nn.Module):
"""
This is a basic backbone for SSD.
The feature extractor outputs a list of 6 feature maps, with the sizes:
[shape(-1, output_channels[0], 38, 38),
shape(-1, output_channels[1], 19, 19),
shape(-1, output_channels[2], 10, 10),
shape(-1, o... | 32.108291 | 98 | 0.539155 | import torch
class BasicModel(torch.nn.Module):
def __init__(self, cfg):
super().__init__()
image_size = cfg.INPUT.IMAGE_SIZE
output_channels = cfg.MODEL.BACKBONE.OUT_CHANNELS
self.output_channels = output_channels
image_channels = cfg.MODEL.BACKBONE.INPUT_CHANNELS
... | true | true |
f72bb74728607daee649873c96466e293323f858 | 400 | py | Python | packages/pytea/pytest/unit_tests/passes/pass_argmax_dim01.py | lego0901/pytea | 8ede650def2e68f4610ba816451d8b9e28f09f76 | [
"MIT"
] | null | null | null | packages/pytea/pytest/unit_tests/passes/pass_argmax_dim01.py | lego0901/pytea | 8ede650def2e68f4610ba816451d8b9e28f09f76 | [
"MIT"
] | null | null | null | packages/pytea/pytest/unit_tests/passes/pass_argmax_dim01.py | lego0901/pytea | 8ede650def2e68f4610ba816451d8b9e28f09f76 | [
"MIT"
] | null | null | null | '''
pass_argmax_dim01.py
Copyright (c) Seoul National University
Licensed under the MIT license.
Author: Woo Sung Song
torch.Tensor.argmax with dim parameter.
! This is not available since maximum stack size exceeding error has been occured
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
a = t... | 21.052632 | 81 | 0.75 |
import torch
import torch.nn as nn
import torch.nn.functional as F
a = torch.rand(2, 3)
| true | true |
f72bb761694ffb3a80f6774d7de879a210505611 | 5,192 | py | Python | backend/game.py | KatrichKostiantin/CheckersGame | 3a552335d3ce344b203129a230d64db303491bb2 | [
"MIT"
] | null | null | null | backend/game.py | KatrichKostiantin/CheckersGame | 3a552335d3ce344b203129a230d64db303491bb2 | [
"MIT"
] | null | null | null | backend/game.py | KatrichKostiantin/CheckersGame | 3a552335d3ce344b203129a230d64db303491bb2 | [
"MIT"
] | null | null | null | import asyncio
import datetime
import logging
import secrets
from main import game
class GameError(Exception):
pass
class ForbiddenMoveError(GameError):
pass
class MoveIsNotPossible(GameError):
pass
class Game:
def __init__(self):
self._game = game
self._is_started = False
... | 30.011561 | 117 | 0.55624 | import asyncio
import datetime
import logging
import secrets
from main import game
class GameError(Exception):
pass
class ForbiddenMoveError(GameError):
pass
class MoveIsNotPossible(GameError):
pass
class Game:
def __init__(self):
self._game = game
self._is_started = False
... | true | true |
f72bb7c009ac666bf6b4d3d4ca6e8865981ed9cf | 3,079 | py | Python | model/app/LearnTfidfCNB.py | jgharris7/DocClass | 9ef62e655272cca8374187040eb3dd73f3f82b72 | [
"MIT"
] | null | null | null | model/app/LearnTfidfCNB.py | jgharris7/DocClass | 9ef62e655272cca8374187040eb3dd73f3f82b72 | [
"MIT"
] | null | null | null | model/app/LearnTfidfCNB.py | jgharris7/DocClass | 9ef62e655272cca8374187040eb3dd73f3f82b72 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 22 22:43:22 2021
@author: jgharris
"""
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 22 21:09:34 2021
@author: jgharris
"""
root='C:/Users/jgharris/DocClass/'
dataFile='/data/shuffled-full-set-hashed.csv'
import statistics as stat
import panda... | 27.008772 | 88 | 0.642416 |
root='C:/Users/jgharris/DocClass/'
dataFile='/data/shuffled-full-set-hashed.csv'
import statistics as stat
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
import matplotlib
import matplotlib.pyplot as plt
import numpy as np... | true | true |
f72bb7e51487a16740709aa74b453a9e4b4dfec5 | 1,107 | py | Python | sortByWeather.py | LeahGabrielle/Clothes | 72a829358ad6a60aef26b7fce80d854451124a32 | [
"Apache-2.0"
] | null | null | null | sortByWeather.py | LeahGabrielle/Clothes | 72a829358ad6a60aef26b7fce80d854451124a32 | [
"Apache-2.0"
] | null | null | null | sortByWeather.py | LeahGabrielle/Clothes | 72a829358ad6a60aef26b7fce80d854451124a32 | [
"Apache-2.0"
] | null | null | null | #clothes by weather
import random
def pickTop(clothesList):
return random.choice(clothesList[0])
def pickBottoms(clothesList):
return random.choice(clothesList[1])
#sorts clothes into weather type and returns a list of clothes of the correct weather
def sortWeather(clothesList, weather):
#eventually com... | 27 | 85 | 0.65673 |
import random
def pickTop(clothesList):
return random.choice(clothesList[0])
def pickBottoms(clothesList):
return random.choice(clothesList[1])
def sortWeather(clothesList, weather):
i=0
for top in clothesList[0]:
if top[2] != weather:
clothesList[0].pop(i)
i+... | true | true |
f72bb87a2474ba7c90c9d75c1d943aae0014a860 | 403 | py | Python | core/mixon_core.py | onuratakan/MIXON | 74d8b1fc7ec2e84dbe4e29f411ae09d701838579 | [
"MIT"
] | 14 | 2021-01-22T20:39:43.000Z | 2022-02-20T00:30:41.000Z | core/mixon_core.py | onuratakan/MIXON | 74d8b1fc7ec2e84dbe4e29f411ae09d701838579 | [
"MIT"
] | null | null | null | core/mixon_core.py | onuratakan/MIXON | 74d8b1fc7ec2e84dbe4e29f411ae09d701838579 | [
"MIT"
] | 3 | 2021-03-20T00:02:24.000Z | 2021-03-22T07:36:49.000Z |
import sys
import os
def start_tojas():
os.system("cd tojas && python3 tojas.py -nb && cd ..")
def start_tojas_gui():
os.system("python3 lib/tojas_gui.py -nb")
def start_scanizen():
os.system("cd scanizen && python3 scanizen.py -nb && cd ..")
def start_doser():
os.system("cd doser && python3 doser.py -n... | 16.791667 | 62 | 0.667494 |
import sys
import os
def start_tojas():
os.system("cd tojas && python3 tojas.py -nb && cd ..")
def start_tojas_gui():
os.system("python3 lib/tojas_gui.py -nb")
def start_scanizen():
os.system("cd scanizen && python3 scanizen.py -nb && cd ..")
def start_doser():
os.system("cd doser && python3 doser.py -n... | true | true |
f72bb9cc461f8b012834228510d2ae37ee6fc7a0 | 2,184 | py | Python | p130_surrounded_regions.py | feigaochn/leetcode | abf0877fae02aa9c2549051f0b68df0ace952512 | [
"MIT"
] | null | null | null | p130_surrounded_regions.py | feigaochn/leetcode | abf0877fae02aa9c2549051f0b68df0ace952512 | [
"MIT"
] | null | null | null | p130_surrounded_regions.py | feigaochn/leetcode | abf0877fae02aa9c2549051f0b68df0ace952512 | [
"MIT"
] | null | null | null | # Surrounded Regions
# Total Accepted: 7716 Total Submissions: 56446 My Submissions
#
# Given a 2D board containing 'X' and 'O', capture all regions surrounded by
# 'X'. A region is captured by flipping all 'O's into 'X's in that surrounded
# region.
#
# For example,
# X X X X
# X O O X
# X X O X
# X O X X
#
# After ru... | 28.736842 | 77 | 0.422619 |
class Solution:
def solve(self, board):
if len(board) is 0:
return
q = []
for j in range(len(board[0])):
if board[0][j] is 'O':
q.append((0, j))
board[0][j] = 'o'
for j in range(len(board[-1])):
... | true | true |
f72bb9ed94ed86bf9e276452065cfabb93084887 | 647 | py | Python | 4.py | Michanix/Math-Stat-Homework | 18f4f915ea0f2dd7fa14ebaeb0d357510aef4808 | [
"MIT"
] | null | null | null | 4.py | Michanix/Math-Stat-Homework | 18f4f915ea0f2dd7fa14ebaeb0d357510aef4808 | [
"MIT"
] | null | null | null | 4.py | Michanix/Math-Stat-Homework | 18f4f915ea0f2dd7fa14ebaeb0d357510aef4808 | [
"MIT"
] | null | null | null | from math import sqrt
from random import randrange
arr1 = [i for i in range(1, 11)]
arr2 = [i for i in range(1, 11)]
arr3 = [randrange(i) for i in range(1, 11)]
arr4 = [randrange(i) for i in range(1, 11)]
def avg(data):
return sum(data) / len(data)
def std(data):
mu = avg(data)
std = (sum([(i - mu)**2 f... | 22.310345 | 61 | 0.591963 | from math import sqrt
from random import randrange
arr1 = [i for i in range(1, 11)]
arr2 = [i for i in range(1, 11)]
arr3 = [randrange(i) for i in range(1, 11)]
arr4 = [randrange(i) for i in range(1, 11)]
def avg(data):
return sum(data) / len(data)
def std(data):
mu = avg(data)
std = (sum([(i - mu)**2 f... | true | true |
f72bba260dbdc0d48d601f070334e34f0095da0b | 6,016 | py | Python | scripts/gdc_req_legacy.py | dampierch/herv | 9f1ce0e676977b6c8d25fdf446c0807826b80bea | [
"MIT"
] | null | null | null | scripts/gdc_req_legacy.py | dampierch/herv | 9f1ce0e676977b6c8d25fdf446c0807826b80bea | [
"MIT"
] | null | null | null | scripts/gdc_req_legacy.py | dampierch/herv | 9f1ce0e676977b6c8d25fdf446c0807826b80bea | [
"MIT"
] | null | null | null | '''
this script queries the gdc legacy archive via the search and retrieve api and
returns msi_status object (from files endpoint on legacy)
-- get uuids of xml files with the msi annotations from legacy server
-- download each xml file
-- parse xml files to extract msi annotations for each subject
script should be ca... | 27.723502 | 79 | 0.562001 |
import io
import json
import os
import pandas as pd
import requests
import re
import subprocess
import glob
import xml.etree.ElementTree as ET
modname = 'gdc_req_legacy'
def set_filters():
filters = {
'op':'and',
'content':[
{'op':'or',
'content':[
{'op'... | true | true |
f72bba363e60dcda05c1e3254d05eaf5e83fbdac | 10,188 | py | Python | esse3api/esse3api.py | hpsc-smartlab/esse3api | 416c52149f28c886cab72671b20b209b40857edf | [
"MIT"
] | 2 | 2018-04-04T15:56:40.000Z | 2018-05-23T11:46:06.000Z | esse3api/esse3api.py | hpsc-smartlab/esse3api | 416c52149f28c886cab72671b20b209b40857edf | [
"MIT"
] | null | null | null | esse3api/esse3api.py | hpsc-smartlab/esse3api | 416c52149f28c886cab72671b20b209b40857edf | [
"MIT"
] | null | null | null |
import json, sys, re, urllib, urllib2, socket, json, pydoc, cgi, os, time, inspect
from hashlib import md5
from datetime import datetime
import time
import csv
from scraper import Scraper
from flask import Flask
from flask import Response
from flask import request
from flask import jsonify
from flask import current_a... | 31.060976 | 116 | 0.575775 |
import json, sys, re, urllib, urllib2, socket, json, pydoc, cgi, os, time, inspect
from hashlib import md5
from datetime import datetime
import time
import csv
from scraper import Scraper
from flask import Flask
from flask import Response
from flask import request
from flask import jsonify
from flask import current_a... | true | true |
f72bba8e3526c1ea6ffcb838cd2c3598c2a72e30 | 3,094 | py | Python | app/forms.py | credwood/bitplayers | 4ca6b6c6a21bb21d7cd963c64028415559c3dcc4 | [
"MIT"
] | 1 | 2020-06-26T21:49:14.000Z | 2020-06-26T21:49:14.000Z | app/forms.py | credwood/bitplayers | 4ca6b6c6a21bb21d7cd963c64028415559c3dcc4 | [
"MIT"
] | 2 | 2020-03-31T11:11:04.000Z | 2021-12-13T20:38:48.000Z | app/forms.py | credwood/bitplayers | 4ca6b6c6a21bb21d7cd963c64028415559c3dcc4 | [
"MIT"
] | null | null | null | from flask_wtf import FlaskForm, RecaptchaField
from wtforms import BooleanField, TextAreaField
from wtforms import PasswordField
from wtforms import StringField
from wtforms import SubmitField, TextField
from wtforms import Form, BooleanField, validators
from wtforms.validators import DataRequired, InputRequired, Equa... | 44.84058 | 145 | 0.72075 | from flask_wtf import FlaskForm, RecaptchaField
from wtforms import BooleanField, TextAreaField
from wtforms import PasswordField
from wtforms import StringField
from wtforms import SubmitField, TextField
from wtforms import Form, BooleanField, validators
from wtforms.validators import DataRequired, InputRequired, Equa... | true | true |
f72bba9d57d9b9c86ad129995eaf5cd82c8bbdc8 | 5,764 | py | Python | test/integration/ggrc/proposal/test_proposal_email.py | MikalaiMikalalai/ggrc-core | f0f83b3638574bb64de474f3b70ed27436ca812a | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-01-12T23:46:00.000Z | 2019-01-12T23:46:00.000Z | test/integration/ggrc/proposal/test_proposal_email.py | MikalaiMikalalai/ggrc-core | f0f83b3638574bb64de474f3b70ed27436ca812a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/integration/ggrc/proposal/test_proposal_email.py | MikalaiMikalalai/ggrc-core | f0f83b3638574bb64de474f3b70ed27436ca812a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright (C) 2020 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""This module contains test about sending emails for proposals."""
import ddt
import mock
from ggrc.notifications import fast_digest
from integration.ggrc import TestCase
from integration.ggrc.api_helper im... | 39.479452 | 79 | 0.653539 |
import ddt
import mock
from ggrc.notifications import fast_digest
from integration.ggrc import TestCase
from integration.ggrc.api_helper import Api
from integration.ggrc.models import factories
@ddt.ddt
class TestProposalEmail(TestCase):
def setUp(self):
super(TestProposalEmail, self).setUp()
self.api = A... | true | true |
f72bbb6109eb7cd126564a721c3685fff15dd47b | 1,919 | py | Python | pyretrommo/gen/player_stats.py | snwhd/pyretrommo | fabb523d9b4385ed8a1ff0b2ac787cc5d88a23b7 | [
"blessing"
] | 1 | 2021-11-25T09:33:30.000Z | 2021-11-25T09:33:30.000Z | pyretrommo/gen/player_stats.py | snwhd/pyretrommo | fabb523d9b4385ed8a1ff0b2ac787cc5d88a23b7 | [
"blessing"
] | null | null | null | pyretrommo/gen/player_stats.py | snwhd/pyretrommo | fabb523d9b4385ed8a1ff0b2ac787cc5d88a23b7 | [
"blessing"
] | null | null | null | #!/usr/bin/env python3
# this file is auto-generated by gen_from_wiki.py
from __future__ import annotations
from .player_class import PlayerClass
from ..stats import Stats
STATS_BY_PLAYER_CLASS = {
PlayerClass.Cleric: [
Stats(*(0, 0, 0, 0, 0, 0, 0, 0)),
Stats(*(17, 11, 8, 9, 12, 12, 10, 11)),
... | 39.163265 | 49 | 0.454924 | from __future__ import annotations
from .player_class import PlayerClass
from ..stats import Stats
STATS_BY_PLAYER_CLASS = {
PlayerClass.Cleric: [
Stats(*(0, 0, 0, 0, 0, 0, 0, 0)),
Stats(*(17, 11, 8, 9, 12, 12, 10, 11)),
Stats(*(23, 15, 9, 11, 15, 14, 12, 13)),
Stats(*(29, 19, 11, ... | true | true |
f72bbba8b340d6dadd4bd602a0a79cc67d8d633b | 236 | py | Python | src/silicium/scene.py | PH-KDX/silicium | 813e8719a4ba381691d3d1b11ea5738bb2ee2d36 | [
"MIT"
] | 2 | 2021-12-12T12:06:46.000Z | 2021-12-12T12:21:18.000Z | src/silicium/scene.py | PH-KDX/silicium | 813e8719a4ba381691d3d1b11ea5738bb2ee2d36 | [
"MIT"
] | 1 | 2021-12-12T12:21:43.000Z | 2021-12-12T22:49:46.000Z | src/silicium/scene.py | PH-KDX/silicium | 813e8719a4ba381691d3d1b11ea5738bb2ee2d36 | [
"MIT"
] | 2 | 2021-12-12T15:13:54.000Z | 2021-12-21T09:08:42.000Z | from dataclasses import dataclass
from abc import ABC, abstractmethod
from .builder import AbstractBuilder
@dataclass
class AbstractScene(ABC):
builder: AbstractBuilder
@abstractmethod
def run(self) -> None:
...
| 16.857143 | 36 | 0.728814 | from dataclasses import dataclass
from abc import ABC, abstractmethod
from .builder import AbstractBuilder
@dataclass
class AbstractScene(ABC):
builder: AbstractBuilder
@abstractmethod
def run(self) -> None:
...
| true | true |
f72bbc0a917dfbe976b673ecf7b7fb9a01ec6ce3 | 1,391 | py | Python | app/user/serializers.py | faridos/my_delivery_app_django | 87b487a064b190bfb8e71ba40e6edb9ebc9bd817 | [
"MIT"
] | null | null | null | app/user/serializers.py | faridos/my_delivery_app_django | 87b487a064b190bfb8e71ba40e6edb9ebc9bd817 | [
"MIT"
] | null | null | null | app/user/serializers.py | faridos/my_delivery_app_django | 87b487a064b190bfb8e71ba40e6edb9ebc9bd817 | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model, authenticate
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
class UserSerializer(serializers.ModelSerializer):
"""Serializer for the users object"""
class Meta:
model = get_user_model()
fields = ('... | 33.119048 | 74 | 0.65133 | from django.contrib.auth import get_user_model, authenticate
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = get_user_model()
fields = ('email', 'password', 'name')
extra_... | true | true |
f72bbc4cec7a7d7ee13488d5aad10549c5740f87 | 171 | py | Python | tests/model_control/detailed/transf_Anscombe/model_control_one_enabled_Anscombe_MovingAverage_Seasonal_MonthOfYear_ARX.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | tests/model_control/detailed/transf_Anscombe/model_control_one_enabled_Anscombe_MovingAverage_Seasonal_MonthOfYear_ARX.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 1 | 2019-11-30T23:39:38.000Z | 2019-12-01T04:34:35.000Z | tests/model_control/detailed/transf_Anscombe/model_control_one_enabled_Anscombe_MovingAverage_Seasonal_MonthOfYear_ARX.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Anscombe'] , ['MovingAverage'] , ['Seasonal_MonthOfYear'] , ['ARX'] ); | 42.75 | 93 | 0.766082 | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Anscombe'] , ['MovingAverage'] , ['Seasonal_MonthOfYear'] , ['ARX'] ); | true | true |
f72bbca3b2e8a2f4ec524e851e80d4cf38f9ab9d | 4,759 | py | Python | David and Pooja/++Validating Linked Mods/Python-3.0/Lib/lib2to3/pgen2/driver.py | LinkedModernismProject/web_code | 4cf6bf53d5c3249e52a75f0a3f57d106e31daf9e | [
"Apache-2.0"
] | 1 | 2015-05-21T23:47:54.000Z | 2015-05-21T23:47:54.000Z | front-end/testsuite-python-lib/Python-3.0/Lib/lib2to3/pgen2/driver.py | MalloyPower/parsing-python | b2bca5eed07ea2af7a2001cd4f63becdfb0570be | [
"MIT"
] | 1 | 2015-10-29T20:51:31.000Z | 2015-10-29T20:51:31.000Z | front-end/testsuite-python-lib/Python-3.0/Lib/lib2to3/pgen2/driver.py | MalloyPower/parsing-python | b2bca5eed07ea2af7a2001cd4f63becdfb0570be | [
"MIT"
] | 1 | 2019-04-11T11:27:01.000Z | 2019-04-11T11:27:01.000Z | # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
# Modifications:
# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Parser driver.
This provides a high-level interface to parse a file into a synta... | 32.59589 | 76 | 0.562093 |
__author__ = "Guido van Rossum <guido@python.org>"
__all__ = ["Driver", "load_grammar"]
import os
import logging
import sys
from . import grammar, parse, token, tokenize, pgen
class Driver(object):
def __init__(self, grammar, convert=None, logger=None):
self.grammar = grammar
if logger is N... | true | true |
f72bbd8a0db5fae809ca9c1b2443d5383f6ae83e | 5,635 | py | Python | sdk/python/pulumi_azure_native/devtestlab/v20180915/list_service_fabric_applicable_schedules.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/devtestlab/v20180915/list_service_fabric_applicable_schedules.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/devtestlab/v20180915/list_service_fabric_applicable_schedules.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 37.317881 | 184 | 0.644898 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
__all__ = [
'ListServiceFabricApplicableSchedulesResult',
'AwaitableListServiceFabricApplicableSchedulesResult',
'list_service_fabric_app... | true | true |
f72bbedeed16b94339a910792bc18059766dde94 | 5,337 | py | Python | alacrity/core.py | OLeoghain/alacrity | d49453f5f998dbaf36006fe7ec6c6753cd5ef4c1 | [
"MIT"
] | null | null | null | alacrity/core.py | OLeoghain/alacrity | d49453f5f998dbaf36006fe7ec6c6753cd5ef4c1 | [
"MIT"
] | null | null | null | alacrity/core.py | OLeoghain/alacrity | d49453f5f998dbaf36006fe7ec6c6753cd5ef4c1 | [
"MIT"
] | null | null | null | #!/bin/python
import importlib
import logging
import os
import sys
import argparse
import shutil
from clint.textui import colored
try:
from alacrity import lib
except ImportError:
lib = importlib.import_module('lib', '../alacrity')
def main():
"""
Entry point for the package, alacrity.exe in win and... | 36.554795 | 79 | 0.564737 |
import importlib
import logging
import os
import sys
import argparse
import shutil
from clint.textui import colored
try:
from alacrity import lib
except ImportError:
lib = importlib.import_module('lib', '../alacrity')
def main():
try:
from alacrity import version
except ImportError:
... | true | true |
f72bbf8d0fa245c9c5a1214dc4f10dd0bf1f40bc | 56,360 | py | Python | release/stubs.min/System/Windows/Forms/__init___parts/NumericUpDown.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 182 | 2017-06-27T02:26:15.000Z | 2022-03-30T18:53:43.000Z | release/stubs.min/System/Windows/Forms/__init___parts/NumericUpDown.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 28 | 2017-06-27T13:38:23.000Z | 2022-03-15T11:19:44.000Z | release/stubs.min/System/Windows/Forms/__init___parts/NumericUpDown.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 67 | 2017-06-28T09:43:59.000Z | 2022-03-20T21:17:10.000Z | class NumericUpDown(UpDownBase,IComponent,IDisposable,IOleControl,IOleObject,IOleInPlaceObject,IOleInPlaceActiveObject,IOleWindow,IViewObject,IViewObject2,IPersist,IPersistStreamInit,IPersistPropertyBag,IPersistStorage,IQuickActivate,ISupportOleDropSource,IDropTarget,ISynchronizeInvoke,IWin32Window,IArrangedElement,IBi... | 24.261731 | 375 | 0.700053 | class NumericUpDown(UpDownBase,IComponent,IDisposable,IOleControl,IOleObject,IOleInPlaceObject,IOleInPlaceActiveObject,IOleWindow,IViewObject,IViewObject2,IPersist,IPersistStreamInit,IPersistPropertyBag,IPersistStorage,IQuickActivate,ISupportOleDropSource,IDropTarget,ISynchronizeInvoke,IWin32Window,IArrangedElement,IBi... | true | true |
f72bc0bbb4aca05776043b6a2bbf09555f2323ed | 498 | py | Python | barberShopControl/core/migrations/0017_reserva_res_servicos.py | YohaneSilva/Barbearia-Amizades | 8550cc5de7a0055be78f9e539de9e5c72a8c3a61 | [
"Apache-2.0"
] | 1 | 2020-03-19T21:09:24.000Z | 2020-03-19T21:09:24.000Z | barberShopControl/core/migrations/0017_reserva_res_servicos.py | YohaneSilva/Barbearia-Amizades | 8550cc5de7a0055be78f9e539de9e5c72a8c3a61 | [
"Apache-2.0"
] | null | null | null | barberShopControl/core/migrations/0017_reserva_res_servicos.py | YohaneSilva/Barbearia-Amizades | 8550cc5de7a0055be78f9e539de9e5c72a8c3a61 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.0.5 on 2020-05-18 04:14
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('core', '0016_auto_20200516_0338'),
]
operations = [
migrations.AddField(
model_name='reserva',
... | 23.714286 | 95 | 0.634538 |
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('core', '0016_auto_20200516_0338'),
]
operations = [
migrations.AddField(
model_name='reserva',
name='res_servicos',
field=m... | true | true |
f72bc16d4a055439bb4d5c75416bba366abd7fa1 | 21,675 | py | Python | generated/nidcpower/nidcpower/_converters.py | AlexHearnNI/nimi-python | 39d7c4d9aa66d826c60a5d700982eff173e051e5 | [
"MIT"
] | null | null | null | generated/nidcpower/nidcpower/_converters.py | AlexHearnNI/nimi-python | 39d7c4d9aa66d826c60a5d700982eff173e051e5 | [
"MIT"
] | null | null | null | generated/nidcpower/nidcpower/_converters.py | AlexHearnNI/nimi-python | 39d7c4d9aa66d826c60a5d700982eff173e051e5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# This file was generated
import nidcpower._visatype as _visatype
import nidcpower.errors as errors
import array
import datetime
import numbers
from functools import singledispatch
@singledispatch
def _convert_repeated_capabilities(arg, prefix): # noqa: F811
'''Base version that should ... | 44.875776 | 289 | 0.705421 | import nidcpower._visatype as _visatype
import nidcpower.errors as errors
import array
import datetime
import numbers
from functools import singledispatch
@singledispatch
def _convert_repeated_capabilities(arg, prefix): raise errors.InvalidRepeatedCapabilityError('Invalid type', type(arg))
@_convert_repeated... | true | true |
f72bc1d5aefbd73272c909b63fc43b86465f5c78 | 29,314 | py | Python | tensor2tensor/layers/discretization.py | spacegoing/t2t_caps | ded708b738fa8966eb7544708c4a785479da4c3c | [
"Apache-2.0"
] | null | null | null | tensor2tensor/layers/discretization.py | spacegoing/t2t_caps | ded708b738fa8966eb7544708c4a785479da4c3c | [
"Apache-2.0"
] | null | null | null | tensor2tensor/layers/discretization.py | spacegoing/t2t_caps | ded708b738fa8966eb7544708c4a785479da4c3c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Tensor2Tensor 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... | 38.877984 | 80 | 0.651395 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from functools import partial
from tensor2tensor.layers import common_layers
import tensorflow as tf
from tensorflow.python.training import moving_averages
def project_hidden(x, projection_tensors, hidden_siz... | true | true |
f72bc2026dd2bf64e09da4b3d2a51aebf0adea83 | 5,122 | py | Python | perfect_information_game/tablebases/symmetry_transform.py | amaarquadri/perfect-information-game | 6755f9633935be762d039ece9c0b646c64de6ab8 | [
"MIT"
] | null | null | null | perfect_information_game/tablebases/symmetry_transform.py | amaarquadri/perfect-information-game | 6755f9633935be762d039ece9c0b646c64de6ab8 | [
"MIT"
] | null | null | null | perfect_information_game/tablebases/symmetry_transform.py | amaarquadri/perfect-information-game | 6755f9633935be762d039ece9c0b646c64de6ab8 | [
"MIT"
] | null | null | null | import numpy as np
from perfect_information_game.games import Chess
from perfect_information_game.utils import iter_product
from perfect_information_game.tablebases import get_verified_chess_subclass
class SymmetryTransform:
# noinspection PyChainedComparisons
PAWNLESS_UNIQUE_SQUARE_INDICES = [(i, j) for i, j... | 40.650794 | 105 | 0.625927 | import numpy as np
from perfect_information_game.games import Chess
from perfect_information_game.utils import iter_product
from perfect_information_game.tablebases import get_verified_chess_subclass
class SymmetryTransform:
PAWNLESS_UNIQUE_SQUARE_INDICES = [(i, j) for i, j in iter_product(Chess.BOARD_SHAPE)
... | true | true |
f72bc25c098c14f516c7757477bbf04b559e5b10 | 8,291 | py | Python | custom_components/dahua/config_flow.py | ikke-zelf/dahua | 9fca03b3d0caf5661efee7d71668a838b0478587 | [
"MIT"
] | null | null | null | custom_components/dahua/config_flow.py | ikke-zelf/dahua | 9fca03b3d0caf5661efee7d71668a838b0478587 | [
"MIT"
] | null | null | null | custom_components/dahua/config_flow.py | ikke-zelf/dahua | 9fca03b3d0caf5661efee7d71668a838b0478587 | [
"MIT"
] | null | null | null | """Adds config flow (UI flow) for Dahua IP cameras."""
import logging
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.core import callback
from homeassistant.helpers.aiohttp_client import async_create_clientsession
from homeassistant.helpers import config_validation as cv
from .c... | 34.983122 | 103 | 0.592329 | import logging
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.core import callback
from homeassistant.helpers.aiohttp_client import async_create_clientsession
from homeassistant.helpers import config_validation as cv
from .client import DahuaClient
from .const import (
CONF_... | true | true |
f72bc3e123cf5d71ec9dfa9b87624f01ea910d05 | 7,358 | py | Python | src/ptb/ptb_enas_controller.py | tremblerz/enas | 329ee3f8beb5e715bf2dad1182cfb5120b3485f9 | [
"Apache-2.0"
] | null | null | null | src/ptb/ptb_enas_controller.py | tremblerz/enas | 329ee3f8beb5e715bf2dad1182cfb5120b3485f9 | [
"Apache-2.0"
] | null | null | null | src/ptb/ptb_enas_controller.py | tremblerz/enas | 329ee3f8beb5e715bf2dad1182cfb5120b3485f9 | [
"Apache-2.0"
] | null | null | null |
import sys
import os
import time
import numpy as np
import tensorflow as tf
from src.utils import get_train_ops
from src.common_ops import stack_lstm
from tensorflow.python.training import moving_averages
class PTBEnasController(object):
def __init__(self,
rhn_depth=5,
lstm_size=... | 33.907834 | 80 | 0.651536 |
import sys
import os
import time
import numpy as np
import tensorflow as tf
from src.utils import get_train_ops
from src.common_ops import stack_lstm
from tensorflow.python.training import moving_averages
class PTBEnasController(object):
def __init__(self,
rhn_depth=5,
lstm_size=... | true | true |
f72bc4838f0722457e558e34b578faff5078826d | 27,139 | py | Python | swift/container/sync.py | ctvera/swift-deb | cf889b6fa8b8059ac5ce2680064d60db7602d166 | [
"Apache-2.0"
] | null | null | null | swift/container/sync.py | ctvera/swift-deb | cf889b6fa8b8059ac5ce2680064d60db7602d166 | [
"Apache-2.0"
] | null | null | null | swift/container/sync.py | ctvera/swift-deb | cf889b6fa8b8059ac5ce2680064d60db7602d166 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2010-2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | 45.765599 | 79 | 0.562659 |
import errno
import os
import uuid
from swift import gettext_ as _
from time import ctime, time
from random import choice, random
from struct import unpack_from
from eventlet import sleep, Timeout
import swift.common.db
from swift.common.db import DatabaseConnectionError
from swift.container.backend import Container... | true | true |
f72bc6e7a5a7d63e1045e7006d2cabcd2f8a9690 | 1,305 | py | Python | oauth2_provider/generators.py | dqfort/django-oauth-toolkit | 492a867499b50f348c28db4ef3e429e8f46dc412 | [
"BSD-2-Clause-FreeBSD"
] | 1,406 | 2018-04-09T18:46:01.000Z | 2022-03-30T00:42:23.000Z | oauth2_provider/generators.py | dqfort/django-oauth-toolkit | 492a867499b50f348c28db4ef3e429e8f46dc412 | [
"BSD-2-Clause-FreeBSD"
] | 625 | 2018-04-08T06:06:29.000Z | 2022-03-28T20:48:19.000Z | oauth2_provider/generators.py | dqfort/django-oauth-toolkit | 492a867499b50f348c28db4ef3e429e8f46dc412 | [
"BSD-2-Clause-FreeBSD"
] | 378 | 2018-04-11T20:08:11.000Z | 2022-03-30T17:53:21.000Z | from oauthlib.common import UNICODE_ASCII_CHARACTER_SET
from oauthlib.common import generate_client_id as oauthlib_generate_client_id
from .settings import oauth2_settings
class BaseHashGenerator:
"""
All generators should extend this class overriding `.hash()` method.
"""
def hash(self):
ra... | 28.369565 | 88 | 0.743295 | from oauthlib.common import UNICODE_ASCII_CHARACTER_SET
from oauthlib.common import generate_client_id as oauthlib_generate_client_id
from .settings import oauth2_settings
class BaseHashGenerator:
def hash(self):
raise NotImplementedError()
class ClientIdGenerator(BaseHashGenerator):
def hash(self... | true | true |
f72bc75458786940b2244977b48352162a62d379 | 767 | py | Python | src/data_consumer.py | perrycao/docker_project | e07c4a388eb4936a5f88f63e291ecb8a115bcbe2 | [
"MIT"
] | null | null | null | src/data_consumer.py | perrycao/docker_project | e07c4a388eb4936a5f88f63e291ecb8a115bcbe2 | [
"MIT"
] | null | null | null | src/data_consumer.py | perrycao/docker_project | e07c4a388eb4936a5f88f63e291ecb8a115bcbe2 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
# version 0.1 2019-05-03 First update
import argparse
from kafka import KafkaConsumer
def consume(_topic_name, _kafka_broker):
"""
helper method to consume certain topic data from kafka broker
"""
consumer = KafkaConsumer(_topic_name, bootstrap_servers=_kafka_broker)
for me... | 26.448276 | 77 | 0.711864 | import argparse
from kafka import KafkaConsumer
def consume(_topic_name, _kafka_broker):
consumer = KafkaConsumer(_topic_name, bootstrap_servers=_kafka_broker)
for message in consumer:
print(message)
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("topic_na... | true | true |
f72bc80b55e85e3fe6182a7b4565c13a421a0651 | 1,734 | py | Python | bioseq/management/commands/import_genome.py | ezequieljsosa/sndg-web | 7763c8fbc83dc92abb9c53326e2fe227bcabf607 | [
"MIT"
] | null | null | null | bioseq/management/commands/import_genome.py | ezequieljsosa/sndg-web | 7763c8fbc83dc92abb9c53326e2fe227bcabf607 | [
"MIT"
] | 2 | 2021-03-10T17:08:59.000Z | 2021-09-29T17:40:48.000Z | bioseq/management/commands/import_genome.py | sndg-arg/covid19-web | fe809c87563a00bbec53c3646338d571fdde6a69 | [
"MIT"
] | null | null | null | import os
import warnings
from tqdm import tqdm
import subprocess as sp
import gzip
from io import StringIO
import Bio.SeqIO as bpio
from django.core.management.base import BaseCommand, CommandError
from django.db import transaction
from bioseq.io.BioIO import BioIO
from Bio import BiopythonWarning, BiopythonParserW... | 36.125 | 115 | 0.703576 | import os
import warnings
from tqdm import tqdm
import subprocess as sp
import gzip
from io import StringIO
import Bio.SeqIO as bpio
from django.core.management.base import BaseCommand, CommandError
from django.db import transaction
from bioseq.io.BioIO import BioIO
from Bio import BiopythonWarning, BiopythonParserW... | true | true |
f72bc81ec96d1edc6e8d005ef6645e2c6fb9e483 | 14,906 | py | Python | models/SHL_2018/transforms.py | HuguesMoreau/Sensors_similariy | 4b8592049c83b03a11f5c57fab247290ee29b8f5 | [
"Apache-2.0"
] | null | null | null | models/SHL_2018/transforms.py | HuguesMoreau/Sensors_similariy | 4b8592049c83b03a11f5c57fab247290ee29b8f5 | [
"Apache-2.0"
] | null | null | null | models/SHL_2018/transforms.py | HuguesMoreau/Sensors_similariy | 4b8592049c83b03a11f5c57fab247290ee29b8f5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This file contains diverse preprocessing functions (mostly norms ans spectrograms),
and basic tests and visualizations.
If you are to work with any IPython console (ex: with Jupyter or spyder), is is advised
to launch a '%matplotlib qt' ,to get clean widow
"""
... | 40.395664 | 216 | 0.619616 |
if __name__ == '__main__': import sys
sys.path.append("../..")
import numpy as np
import torch
import scipy.signal, scipy.interpolate, scipy.ndimage
from param import classes_names, fs, duration_window, duration_overlap, spectro_batch_size
from models.SHL_2018 import Datasets
if __name__ == "... | true | true |
f72bc8fafdff910faf1d81e8260be95f5fd4d2f1 | 6,823 | py | Python | lib/rpn_layer/proposal_target_layer.py | aditya2592/PoseCNN | a763120ce0ceb55cf3432980287ef463728f8052 | [
"MIT"
] | 655 | 2018-03-21T19:55:45.000Z | 2022-03-25T20:41:21.000Z | lib/rpn_layer/proposal_target_layer.py | SergioRAgostinho/PoseCNN | da9eaae850eed7521a2a48a4d27474d655caab42 | [
"MIT"
] | 122 | 2018-04-04T13:57:49.000Z | 2022-03-18T09:28:44.000Z | lib/rpn_layer/proposal_target_layer.py | SergioRAgostinho/PoseCNN | da9eaae850eed7521a2a48a4d27474d655caab42 | [
"MIT"
] | 226 | 2018-03-22T01:40:04.000Z | 2022-03-17T11:56:14.000Z | # --------------------------------------------------------
# Faster R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick, Sean Bell and Xinlei Chen
# --------------------------------------------------------
from __future__ import absolute_import
from... | 39.212644 | 118 | 0.725194 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import numpy.random as npr
from fcn.config import cfg
from utils.bbox_transform import bbox_transform
from utils.cython_bbox import bbox_overlaps
def proposal_target_layer(rpn_rois, rpn_scor... | true | true |
f72bca34371f9e866f547515c6eb963685418158 | 3,878 | py | Python | alveo/apps/whole_app_acceleration/classification/test_classify_pp.py | dendisuhubdy/Vitis-AI | 524f65224c52314155dafc011d488ed30e458fcb | [
"Apache-2.0"
] | 3 | 2020-10-29T15:00:30.000Z | 2021-10-21T08:09:34.000Z | alveo/apps/whole_app_acceleration/classification/test_classify_pp.py | dendisuhubdy/Vitis-AI | 524f65224c52314155dafc011d488ed30e458fcb | [
"Apache-2.0"
] | 20 | 2020-10-31T03:19:03.000Z | 2020-11-02T18:59:49.000Z | alveo/apps/whole_app_acceleration/classification/test_classify_pp.py | dendisuhubdy/Vitis-AI | 524f65224c52314155dafc011d488ed30e458fcb | [
"Apache-2.0"
] | 9 | 2020-10-14T02:04:10.000Z | 2020-12-01T08:23:02.000Z | # Copyright 2019 Xilinx Inc.
# Copyright 2019 Xilinx Inc.
#
# 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 ... | 34.318584 | 183 | 0.687726 |
from __future__ import print_function
from six import itervalues, iteritems
from ctypes import *
import numpy as np
import os, sys
from vai.dpuv1.rt import xdnn, xdnn_io
from vai.dpuv1.rt.vitis.python.dpu.runner import Runner
import waa_rt
import multiprocessing as mp
import ctypes
def pre_process(q,args):
xclb... | true | true |
f72bca80139a374bf9bcf9170ec60403226e508e | 5,931 | py | Python | code/networks/Unet.py | loveredcarrot/ssl_multi_seg | 5315dbcc2c44e8effab28699c1491dd67b7ce00b | [
"Apache-2.0"
] | 3 | 2021-04-28T09:36:32.000Z | 2021-11-17T02:52:07.000Z | code/networks/Unet.py | loveredcarrot/ssl_multi_seg | 5315dbcc2c44e8effab28699c1491dd67b7ce00b | [
"Apache-2.0"
] | null | null | null | code/networks/Unet.py | loveredcarrot/ssl_multi_seg | 5315dbcc2c44e8effab28699c1491dd67b7ce00b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time : 2021/4/8 15:52
# @Author : aurorazeng
# @File : Unet.py
# @license: (C) Copyright 2021-2026, aurorazeng; No reprobaiction without permission.
"""
The implementation is borrowed from: https://github.com/HiLab-git/PyMIC
"""
from __future__ import division, print_function
import nump... | 31.887097 | 85 | 0.572079 |
from __future__ import division, print_function
import numpy as np
import torch
import torch.nn as nn
from torch.distributions.uniform import Uniform
class ConvBlock(nn.Module):
def __init__(self, in_channels, out_channels, dropout_p):
super(ConvBlock, self).__init__()
self.conv_conv = nn.Sequ... | true | true |
f72bca982790961f6bbe8bc31f1a60032438e1a2 | 154 | py | Python | chat_assistant/chat_assistant_app/urls.py | mrhegemon/Rasa_zero_rpc_XR_bot | a468cc1f2b1a4e935ce18e97dcb7a11070bbea0b | [
"MIT"
] | 1 | 2021-06-21T10:44:51.000Z | 2021-06-21T10:44:51.000Z | chat_assistant/chat_assistant_app/urls.py | mrhegemon/Rasa_zero_rpc_XR_bot | a468cc1f2b1a4e935ce18e97dcb7a11070bbea0b | [
"MIT"
] | null | null | null | chat_assistant/chat_assistant_app/urls.py | mrhegemon/Rasa_zero_rpc_XR_bot | a468cc1f2b1a4e935ce18e97dcb7a11070bbea0b | [
"MIT"
] | 1 | 2021-06-07T23:09:30.000Z | 2021-06-07T23:09:30.000Z | from django.conf.urls import url
from . import views
urlpatterns = [
url('', views.chat, name='chat'),
url('^chat/', views.chat, name='chat'),
]
| 19.25 | 43 | 0.62987 | from django.conf.urls import url
from . import views
urlpatterns = [
url('', views.chat, name='chat'),
url('^chat/', views.chat, name='chat'),
]
| true | true |
f72bcb05e1a89751517adfac4596a0dd60fe06f8 | 2,516 | py | Python | actions/macro/building_positioning.py | drakonnan1st/JackBot | 345df784098cb9eb055b3901fe7455807c58a4e1 | [
"MIT"
] | null | null | null | actions/macro/building_positioning.py | drakonnan1st/JackBot | 345df784098cb9eb055b3901fe7455807c58a4e1 | [
"MIT"
] | null | null | null | actions/macro/building_positioning.py | drakonnan1st/JackBot | 345df784098cb9eb055b3901fe7455807c58a4e1 | [
"MIT"
] | null | null | null | """Everything related to building positioning goes here"""
from sc2.constants import EVOLUTIONCHAMBER, ENGINEERINGBAY
from sc2.data import ACTION_RESULT
from sc2.position import Point2
class BuildingPositioning:
"""Ok for now"""
async def prepare_building_positions(self, center):
"""Check all possibl... | 45.745455 | 114 | 0.604134 | from sc2.constants import EVOLUTIONCHAMBER, ENGINEERINGBAY
from sc2.data import ACTION_RESULT
from sc2.position import Point2
class BuildingPositioning:
async def prepare_building_positions(self, center):
mineral_field = self.state.mineral_field
if mineral_field:
close_points = range(... | true | true |
f72bcbbdf799538cf2dba7ece50cc212bc7de632 | 1,341 | py | Python | 2020/day03/toboggan_trajectory.py | rycmak/advent-of-code | 2a3289516f4c1d0bc1d24a38d495a93edcb19e29 | [
"MIT"
] | 1 | 2021-03-03T01:40:09.000Z | 2021-03-03T01:40:09.000Z | 2020/day03/toboggan_trajectory.py | rycmak/advent-of-code | 2a3289516f4c1d0bc1d24a38d495a93edcb19e29 | [
"MIT"
] | null | null | null | 2020/day03/toboggan_trajectory.py | rycmak/advent-of-code | 2a3289516f4c1d0bc1d24a38d495a93edcb19e29 | [
"MIT"
] | null | null | null | # Pseudo code:
# assume original map is narrow (has more rows than columns)
# transform map to array
# no. of steps downwards = no. of rows
# no. of map copies = ceil((no. of steps downwards - 1) * 3 / no. of columns)
# start at (i, j) = (0, 0)
# move across to (i + 3, j + 1)
# if element == '#', increment num_trees
#... | 31.928571 | 108 | 0.681581 |
# NB: If using numpy, could make use of concatenate, hstack, etc.
# to stack (repeat) copies of original map to the right.
# But without numpy, we'll try to use zip instead...
file = open("input.txt", "r")
map_original = [] num_rows = 0
for line in file:
num_rows += 1
map_original.append(list(line.strip()))
ma... | true | true |
f72bcbc28f844d28924574ebaa52197a6519cc46 | 380 | py | Python | api.py | BabakShah/DS-SafetyPrediction | bc4c99512d04fa73994616584e3f4ab78c3e979e | [
"MIT"
] | null | null | null | api.py | BabakShah/DS-SafetyPrediction | bc4c99512d04fa73994616584e3f4ab78c3e979e | [
"MIT"
] | null | null | null | api.py | BabakShah/DS-SafetyPrediction | bc4c99512d04fa73994616584e3f4ab78c3e979e | [
"MIT"
] | 2 | 2021-06-29T17:28:03.000Z | 2022-02-26T08:41:35.000Z | import pickle
import numpy as np
xgboost = pickle.load(open('./xgboost.pkl', 'rb'))
scaler = pickle.load(open('./scaler.pkl', 'rb'))
def transform_input(input):
return scaler.transform([input])
def make_hard_prediction(input):
return xgboost.predict(transform_input(input))
def make_soft_prediction(input):
... | 23.75 | 61 | 0.747368 | import pickle
import numpy as np
xgboost = pickle.load(open('./xgboost.pkl', 'rb'))
scaler = pickle.load(open('./scaler.pkl', 'rb'))
def transform_input(input):
return scaler.transform([input])
def make_hard_prediction(input):
return xgboost.predict(transform_input(input))
def make_soft_prediction(input):
... | true | true |
f72bcd0625e2740abc5c1c5b36b3afdb5cde844c | 6,402 | py | Python | train_dalle.py | Atica57/DALLE-pytorch | 4fa108271aeb1972fcb118390ec15b656f2c328a | [
"MIT"
] | 1 | 2021-03-08T12:26:49.000Z | 2021-03-08T12:26:49.000Z | train_dalle.py | Atica57/DALLE-pytorch | 4fa108271aeb1972fcb118390ec15b656f2c328a | [
"MIT"
] | null | null | null | train_dalle.py | Atica57/DALLE-pytorch | 4fa108271aeb1972fcb118390ec15b656f2c328a | [
"MIT"
] | null | null | null | import argparse
from random import choice
from pathlib import Path
# torch
import torch
from torch.optim import Adam
from torch.nn.utils import clip_grad_norm_
# vision imports
from PIL import Image
from torchvision import transforms as T
from torch.utils.data import DataLoader, Dataset
from torchvision.datasets im... | 24.813953 | 110 | 0.617619 | import argparse
from random import choice
from pathlib import Path
import torch
from torch.optim import Adam
from torch.nn.utils import clip_grad_norm_
from PIL import Image
from torchvision import transforms as T
from torch.utils.data import DataLoader, Dataset
from torchvision.datasets import ImageFolder
from tor... | true | true |
f72bcdcacf211151e2476c6876771adc77e8a368 | 930 | py | Python | CartPole/_CartPole_mathematical_helpers.py | jhuebotter/CartpoleSNNdemo | d18a85cbc45bff48295c46c9cd8c9fc00192318c | [
"MIT"
] | null | null | null | CartPole/_CartPole_mathematical_helpers.py | jhuebotter/CartpoleSNNdemo | d18a85cbc45bff48295c46c9cd8c9fc00192318c | [
"MIT"
] | null | null | null | CartPole/_CartPole_mathematical_helpers.py | jhuebotter/CartpoleSNNdemo | d18a85cbc45bff48295c46c9cd8c9fc00192318c | [
"MIT"
] | null | null | null | """
Small general mathematical functions.
This file was necessary to make CartPole module self-contained.
"""
from math import fmod
import numpy as np
# Wraps the angle into range [-π, π]
def wrap_angle_rad(angle: float) -> float:
Modulo = fmod(angle, 2 * np.pi) # positive modulo
if Modulo < -np.pi:
... | 25.833333 | 66 | 0.649462 |
from math import fmod
import numpy as np
def wrap_angle_rad(angle: float) -> float:
Modulo = fmod(angle, 2 * np.pi) if Modulo < -np.pi:
angle = Modulo + 2 * np.pi
elif Modulo > np.pi:
angle = Modulo - 2 * np.pi
else:
angle = Modulo
return angle
def wrap_angle_rad_inplac... | true | true |
f72bce4067eef5d32a5ccf8b7a440fc4ed4d0c42 | 1,114 | py | Python | dadmatools/models/flair/parser/utils/vocab.py | njzr/DadmaTools | 64ff407d5d818d5a9216340cccf0d1cc909d3b1b | [
"Apache-2.0"
] | 25 | 2021-12-01T15:19:36.000Z | 2022-03-12T12:50:28.000Z | dadmatools/models/flair/parser/utils/vocab.py | ebad84/DadmaTools | b26ad8aa834f642d49bd120bd7cf1fdf40741be1 | [
"Apache-2.0"
] | 3 | 2021-12-14T06:34:52.000Z | 2022-02-17T08:23:20.000Z | dadmatools/models/flair/parser/utils/vocab.py | ebad84/DadmaTools | b26ad8aa834f642d49bd120bd7cf1fdf40741be1 | [
"Apache-2.0"
] | 6 | 2021-10-12T13:44:17.000Z | 2022-03-07T13:54:17.000Z | # -*- coding: utf-8 -*-
from collections.abc import Iterable
from dadmatools.models.flair.parser.utils.common import unk
class Vocab(object):
def __init__(self, counter, min_freq=1, specials=[]):
self.itos = specials
self.stoi = {token: i for i, token in enumerate(self.itos)}
self.exten... | 28.564103 | 75 | 0.61939 |
from collections.abc import Iterable
from dadmatools.models.flair.parser.utils.common import unk
class Vocab(object):
def __init__(self, counter, min_freq=1, specials=[]):
self.itos = specials
self.stoi = {token: i for i, token in enumerate(self.itos)}
self.extend([token for token, freq... | true | true |
f72bd002b56ea30cddba78b9525df205cb9088df | 7,561 | py | Python | tests/lint/check_file_type.py | PhilippvK/tvm | e7748aac40bd4c263882323393ea8896837614a9 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | null | null | null | tests/lint/check_file_type.py | PhilippvK/tvm | e7748aac40bd4c263882323393ea8896837614a9 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | null | null | null | tests/lint/check_file_type.py | PhilippvK/tvm | e7748aac40bd4c263882323393ea8896837614a9 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 28.003704 | 118 | 0.624653 | import os
import sys
import subprocess
ALLOW_EXTENSION = {
"cc",
"c",
"h",
"s",
"rs",
"m",
"mm",
"g4",
"gradle",
"js",
"tcl",
"scala",
"java",
"go",
"ts",
"sh",
"py",
"pyi",
"pxi",
"pyd",
"pyx",
"cu",
"bat",
"rly",
... | true | true |
f72bd0034cfdcd02a88b42c82d265f8271a74c19 | 30,361 | py | Python | covid/wallet/cc_wallet/cc_wallet.py | grayfallstown/covid-blockchain | 194d5351c70d3ee5d928f767e21c7894cfbb59a7 | [
"Apache-2.0"
] | null | null | null | covid/wallet/cc_wallet/cc_wallet.py | grayfallstown/covid-blockchain | 194d5351c70d3ee5d928f767e21c7894cfbb59a7 | [
"Apache-2.0"
] | null | null | null | covid/wallet/cc_wallet/cc_wallet.py | grayfallstown/covid-blockchain | 194d5351c70d3ee5d928f767e21c7894cfbb59a7 | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
import logging
import time
from dataclasses import replace
from secrets import token_bytes
from typing import Any, Dict, List, Optional, Set
from blspy import AugSchemeMPL, G2Element
from covid.consensus.cost_calculator import calculate_cost_of_program, NPCResult
from covid.full_no... | 40.589572 | 118 | 0.647969 | from __future__ import annotations
import logging
import time
from dataclasses import replace
from secrets import token_bytes
from typing import Any, Dict, List, Optional, Set
from blspy import AugSchemeMPL, G2Element
from covid.consensus.cost_calculator import calculate_cost_of_program, NPCResult
from covid.full_no... | true | true |
f72bd026e80c9b36f6569dca3e1e436f15855ecb | 417 | py | Python | tests/integration/test_segway_train.py | procha2/segway-pipeline | d0d3b8603eea9c9cbe92b56899c670dc41e89ca8 | [
"MIT"
] | 1 | 2021-03-13T11:34:45.000Z | 2021-03-13T11:34:45.000Z | tests/integration/test_segway_train.py | procha2/segway-pipeline | d0d3b8603eea9c9cbe92b56899c670dc41e89ca8 | [
"MIT"
] | null | null | null | tests/integration/test_segway_train.py | procha2/segway-pipeline | d0d3b8603eea9c9cbe92b56899c670dc41e89ca8 | [
"MIT"
] | 1 | 2020-10-01T11:48:17.000Z | 2020-10-01T11:48:17.000Z | from pathlib import Path
import pytest
@pytest.mark.workflow("test_segway_train")
def test_segway_train_traindirs_match(test_data_dir, workflow_dir, traindirs_match):
actual_traindir_path = workflow_dir / Path("test-output/traindir.tar.gz")
expected_traindir_path = test_data_dir / Path("segway_train_traindir... | 37.909091 | 86 | 0.822542 | from pathlib import Path
import pytest
@pytest.mark.workflow("test_segway_train")
def test_segway_train_traindirs_match(test_data_dir, workflow_dir, traindirs_match):
actual_traindir_path = workflow_dir / Path("test-output/traindir.tar.gz")
expected_traindir_path = test_data_dir / Path("segway_train_traindir... | true | true |
f72bd02dde43d0b610faacf919e7788a178ef0a9 | 1,359 | py | Python | vsts/vsts/service_endpoint/v4_1/models/service_endpoint_execution_owner.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | vsts/vsts/service_endpoint/v4_1/models/service_endpoint_execution_owner.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | vsts/vsts/service_endpoint/v4_1/models/service_endpoint_execution_owner.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 39.970588 | 94 | 0.532009 |
from msrest.serialization import Model
class ServiceEndpointExecutionOwner(Model):
_attribute_map = {
'_links': {'key': '_links', 'type': 'ReferenceLinks'},
'id': {'key': 'id', 'type': 'int'},
'name': {'key': 'name', 'type': 'str'}
}
def __init__(self, _links=None, id=None, name... | true | true |
f72bd05b364336d0dfa60b4f0cb91cab8257f3a8 | 17,511 | py | Python | cirq-google/cirq_google/serialization/op_serializer_test.py | augustehirth/Cirq | e616710a0fa243524a9f6d7bc0d35e6b952fe3d0 | [
"Apache-2.0"
] | null | null | null | cirq-google/cirq_google/serialization/op_serializer_test.py | augustehirth/Cirq | e616710a0fa243524a9f6d7bc0d35e6b952fe3d0 | [
"Apache-2.0"
] | null | null | null | cirq-google/cirq_google/serialization/op_serializer_test.py | augustehirth/Cirq | e616710a0fa243524a9f6d7bc0d35e6b952fe3d0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 32.669776 | 100 | 0.640911 |
from typing import Dict, List
import copy
import numpy as np
import pytest
import sympy
from google.protobuf import json_format
import cirq
import cirq_google as cg
from cirq_google.api import v2
DEFAULT_TOKEN = 'test_tag'
def op_proto(json: Dict) -> v2.program_pb2.Operation:
op = v2.program_pb2.Operation()... | true | true |
f72bd06d2f9f175effe7beb9a4509946d29b33e0 | 158 | py | Python | build.py | pengguanjun/zeno_learn | bd5298f14180f1b2ce1edb83305bbc2ce4c7d0c8 | [
"MIT"
] | 4 | 2021-08-03T16:26:52.000Z | 2022-03-30T10:32:23.000Z | build.py | pengguanjun/zeno_learn | bd5298f14180f1b2ce1edb83305bbc2ce4c7d0c8 | [
"MIT"
] | 1 | 2021-11-09T10:54:24.000Z | 2021-11-09T10:54:24.000Z | build.py | pengguanjun/zeno_learn | bd5298f14180f1b2ce1edb83305bbc2ce4c7d0c8 | [
"MIT"
] | 3 | 2021-11-09T10:48:16.000Z | 2021-11-09T15:18:02.000Z | #!/usr/bin/env python3
import subprocess
subprocess.check_call(['cmake', '-B', 'build'])
subprocess.check_call(['cmake', '--build', 'build', '--parallel'])
| 22.571429 | 66 | 0.670886 |
import subprocess
subprocess.check_call(['cmake', '-B', 'build'])
subprocess.check_call(['cmake', '--build', 'build', '--parallel'])
| true | true |
f72bd075c6cfb39433750fb4807078e2c2bb2e91 | 4,623 | py | Python | SuperB/api/serializers.py | rialrustamov/SuperB-E-Commerce-RR | 099fcfb50bd1623237fd352a87d19926dda52904 | [
"MIT"
] | null | null | null | SuperB/api/serializers.py | rialrustamov/SuperB-E-Commerce-RR | 099fcfb50bd1623237fd352a87d19926dda52904 | [
"MIT"
] | null | null | null | SuperB/api/serializers.py | rialrustamov/SuperB-E-Commerce-RR | 099fcfb50bd1623237fd352a87d19926dda52904 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from django.db.models import fields
from product.models import Product, ProductVersion, Category, Review, Image
from order.models import ShoppingCart, Wishlist, CartItem
from blog.models import Category as BlogCategory, Blog
from django.contrib.auth import get_user_model
from use... | 28.361963 | 110 | 0.689812 | from rest_framework import serializers
from django.db.models import fields
from product.models import Product, ProductVersion, Category, Review, Image
from order.models import ShoppingCart, Wishlist, CartItem
from blog.models import Category as BlogCategory, Blog
from django.contrib.auth import get_user_model
from use... | true | true |
f72bd109a480d8206801746e5910512f5d37e064 | 444 | py | Python | tests/test_cpplibhub.py | iotanbo/cpplibhub | 0758d416c8d2c0b29d70300f25ccc898a7ad64df | [
"MIT"
] | null | null | null | tests/test_cpplibhub.py | iotanbo/cpplibhub | 0758d416c8d2c0b29d70300f25ccc898a7ad64df | [
"MIT"
] | null | null | null | tests/test_cpplibhub.py | iotanbo/cpplibhub | 0758d416c8d2c0b29d70300f25ccc898a7ad64df | [
"MIT"
] | null | null | null |
import pytest
from click.testing import CliRunner
from cpplibhub.cli import main
@pytest.fixture(scope="module")
def runner():
return CliRunner()
def test_main(runner):
# assert main([]) == 0 # run without click
result = runner.invoke(main)
# result = runner.invoke(main, ['--name', 'Amy'])
as... | 22.2 | 53 | 0.671171 |
import pytest
from click.testing import CliRunner
from cpplibhub.cli import main
@pytest.fixture(scope="module")
def runner():
return CliRunner()
def test_main(runner):
result = runner.invoke(main)
assert result.exit_code == 0
| true | true |
f72bd1370d655bb4ca4fe412e26c161f507ca79b | 7,667 | py | Python | lib/dblatex-0.3.2/lib/dbtexmf/dblatex/grubber/plugins.py | jonathanmorley/HR-XSL | 799b1075cbec4cda3d686d588eea92a62d59963f | [
"Apache-2.0"
] | 1 | 2017-12-29T23:23:14.000Z | 2017-12-29T23:23:14.000Z | lib/dblatex-0.3.2/lib/dbtexmf/dblatex/grubber/plugins.py | jonathanmorley/HR-XSL | 799b1075cbec4cda3d686d588eea92a62d59963f | [
"Apache-2.0"
] | null | null | null | lib/dblatex-0.3.2/lib/dbtexmf/dblatex/grubber/plugins.py | jonathanmorley/HR-XSL | 799b1075cbec4cda3d686d588eea92a62d59963f | [
"Apache-2.0"
] | null | null | null | # This file is part of Rubber and thus covered by the GPL
# (c) Emmanuel Beffara, 2002--2006
"""
Mechanisms to dynamically load extra modules to help the LaTeX compilation.
All the modules must be derived from the TexModule class.
"""
import imp
from os.path import *
from msg import _, msg
import sys
class TexModule... | 33.480349 | 78 | 0.589148 | import imp
from os.path import *
from msg import _, msg
import sys
class TexModule (object):
def __init__ (self, env, dict):
def pre_compile (self):
return 0
def post_compile (self):
return 0
def last_compile (self):
return 0
def clean (self):
def command (self, c... | true | true |
f72bd2060174e51a551060a884d7fdfeb1276fa6 | 15,646 | py | Python | pandaharvester/harvesterbody/master.py | nikmagini/harvester | 1d62dd0e35b53a51919b0250fffec478778f460a | [
"Apache-2.0"
] | 11 | 2017-06-01T10:16:58.000Z | 2019-11-22T08:41:36.000Z | pandaharvester/harvesterbody/master.py | nikmagini/harvester | 1d62dd0e35b53a51919b0250fffec478778f460a | [
"Apache-2.0"
] | 34 | 2016-10-25T19:15:24.000Z | 2021-03-05T12:59:04.000Z | pandaharvester/harvesterbody/master.py | nikmagini/harvester | 1d62dd0e35b53a51919b0250fffec478778f460a | [
"Apache-2.0"
] | 17 | 2016-10-24T13:29:45.000Z | 2021-03-23T17:35:27.000Z | import os
import pwd
import grp
import sys
import socket
import signal
import logging
import daemon.pidfile
import argparse
import threading
import cProfile
import atexit
from future.utils import iteritems
try:
import pprofile
except Exception:
pass
from pandalogger import logger_config
from pandaharvester im... | 37.430622 | 104 | 0.604244 | import os
import pwd
import grp
import sys
import socket
import signal
import logging
import daemon.pidfile
import argparse
import threading
import cProfile
import atexit
from future.utils import iteritems
try:
import pprofile
except Exception:
pass
from pandalogger import logger_config
from pandaharvester im... | true | true |
f72bd257412e17141e60758b6a2232418acfb73b | 895 | py | Python | sdks/python/test/test_PurgeResponse.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | null | null | null | sdks/python/test/test_PurgeResponse.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 6 | 2019-10-23T06:38:53.000Z | 2022-01-22T07:57:58.000Z | sdks/python/test/test_PurgeResponse.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 2 | 2019-10-23T06:31:05.000Z | 2021-08-21T17:32:47.000Z | # coding: utf-8
"""
App Center Client
Microsoft Visual Studio App Center API # noqa: E501
OpenAPI spec version: preview
Contact: benedetto.abbenanti@gmail.com
Project Repository: https://github.com/b3nab/appcenter-sdks
"""
from __future__ import absolute_import
import unittest
import appcente... | 22.375 | 85 | 0.709497 |
from __future__ import absolute_import
import unittest
import appcenter_sdk
from PurgeResponse.clsPurgeResponse import PurgeResponse from appcenter_sdk.rest import ApiException
class TestPurgeResponse(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def testPurgeR... | true | true |
f72bd2eca21eed63e0f6123f34b5568c86396f4a | 176,314 | py | Python | mkt/reviewers/tests/test_views.py | jasonthomas/zamboni | 948247609cb4b2ed72e6daa4da5257927bfe0c17 | [
"BSD-3-Clause"
] | null | null | null | mkt/reviewers/tests/test_views.py | jasonthomas/zamboni | 948247609cb4b2ed72e6daa4da5257927bfe0c17 | [
"BSD-3-Clause"
] | null | null | null | mkt/reviewers/tests/test_views.py | jasonthomas/zamboni | 948247609cb4b2ed72e6daa4da5257927bfe0c17 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import json
import re
import time
from datetime import datetime, timedelta
from itertools import cycle
from os import path
from django import test
from django.conf import settings
from django.core import mail
from django.core.urlresolvers import reverse
from django.test.client import RequestFac... | 40.79454 | 79 | 0.620518 | import json
import re
import time
from datetime import datetime, timedelta
from itertools import cycle
from os import path
from django import test
from django.conf import settings
from django.core import mail
from django.core.urlresolvers import reverse
from django.test.client import RequestFactory
from django.test.ut... | true | true |
f72bd40ce088f4120389f93fcd804f18f5fdfbf5 | 7,929 | py | Python | tests/rastrigin_accept_action.py | LiyrAstroph/CDNest | afb6b869ce1c4ebd76662b20310f1d9d3db4e26e | [
"MIT"
] | 6 | 2019-09-11T03:34:45.000Z | 2020-10-16T12:14:05.000Z | tests/rastrigin_accept_action.py | LiyrAstroph/DNest_C | afb6b869ce1c4ebd76662b20310f1d9d3db4e26e | [
"MIT"
] | 2 | 2020-05-14T10:04:48.000Z | 2021-01-06T02:04:19.000Z | tests/rastrigin_accept_action.py | LiyrAstroph/DNest_C | afb6b869ce1c4ebd76662b20310f1d9d3db4e26e | [
"MIT"
] | null | null | null | #
# sample from a Rastrigin test function
# this is to illustrate how to use accept_action in CDNest to avoid repeat calculations.
#
# A 2D Rastrigin function looks
#
# logL=-(10.0*2 + (coords[0]**2 - 10*np.cos(2.0*np.pi*coords[0])) + (coords[1]**2 - 10*np.cos(2.0*np.pi*coords[1])) )
#
# Every perturb, only one param... | 37.225352 | 118 | 0.66137 |
from mpi4py import MPI
import numpy as np
import cydnest
import matplotlib.pyplot as plt
from matplotlib import cm
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
def randh():
return 10.0**(1.5 - 3*np.abs(np.random.randn()/np.sqrt(-np.log(np.random.rand()))))*np.random.randn()
def wrap(x, a, b):
assert b > a
ret... | true | true |
f72bd6613a23fb41a75040d39b206992b03cd8d2 | 27,303 | py | Python | catalyst/marketplace/marketplace.py | echo-ray/catalyst | 8b4274d17f0a42ee4d1d5e09d30fb0919aea2a51 | [
"Apache-2.0"
] | null | null | null | catalyst/marketplace/marketplace.py | echo-ray/catalyst | 8b4274d17f0a42ee4d1d5e09d30fb0919aea2a51 | [
"Apache-2.0"
] | null | null | null | catalyst/marketplace/marketplace.py | echo-ray/catalyst | 8b4274d17f0a42ee4d1d5e09d30fb0919aea2a51 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import glob
import json
import os
import re
import shutil
import sys
import time
import webbrowser
import bcolz
import logbook
import pandas as pd
import requests
from requests_toolbelt import MultipartDecoder
from requests_toolbelt.multipart.decoder import \
NonMultipartCont... | 34.430013 | 79 | 0.517892 | from __future__ import print_function
import glob
import json
import os
import re
import shutil
import sys
import time
import webbrowser
import bcolz
import logbook
import pandas as pd
import requests
from requests_toolbelt import MultipartDecoder
from requests_toolbelt.multipart.decoder import \
NonMultipartCont... | true | true |
f72bd87c0f6308b1597913764a10b8ad4d63132c | 2,172 | py | Python | coevolution_transformer/model/msa_embeddings.py | microsoft/Protein-Folding | f534b2dd1e3f192fbcdadf234f25828c7f458a58 | [
"MIT"
] | 1 | 2021-11-12T03:00:28.000Z | 2021-11-12T03:00:28.000Z | coevolution_transformer/model/msa_embeddings.py | microsoft/Protein-Folding | f534b2dd1e3f192fbcdadf234f25828c7f458a58 | [
"MIT"
] | 1 | 2022-01-11T17:09:26.000Z | 2022-01-11T17:09:26.000Z | coevolution_transformer/model/msa_embeddings.py | microsoft/Protein-Folding | f534b2dd1e3f192fbcdadf234f25828c7f458a58 | [
"MIT"
] | 2 | 2021-11-10T11:42:11.000Z | 2021-12-09T05:37:09.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import math
import torch
from torch import nn
import torch.nn.functional as F
class PositionalEncoding(nn.Module):
def __init__(self, d_model, max_len=1 << 13):
super(PositionalEncoding, self).__init__()
self.ninp = d_model
... | 36.2 | 98 | 0.603131 | import math
import torch
from torch import nn
import torch.nn.functional as F
class PositionalEncoding(nn.Module):
def __init__(self, d_model, max_len=1 << 13):
super(PositionalEncoding, self).__init__()
self.ninp = d_model
pe = torch.zeros(max_len, d_model)
position = torch.arang... | true | true |
f72bd8ae65fb7e4bb2f7694fe3f07aad90af90c7 | 5,513 | py | Python | pywavefront/material.py | elgrandt/ShooterInc | 0552e563d9ea81b0e0a0c4be1648412aa52c56e6 | [
"MIT"
] | null | null | null | pywavefront/material.py | elgrandt/ShooterInc | 0552e563d9ea81b0e0a0c4be1648412aa52c56e6 | [
"MIT"
] | null | null | null | pywavefront/material.py | elgrandt/ShooterInc | 0552e563d9ea81b0e0a0c4be1648412aa52c56e6 | [
"MIT"
] | null | null | null | # ----------------------------------------------------------------------------
# PyWavefront
# Copyright (c) 2013 Kurt Yoder
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribution... | 35.339744 | 79 | 0.649737 |
from OpenGL.GL import *
import pywavefront.parser as parser
import pywavefront.texture as texture
class Material(object):
def __init__(self, name):
self.name = name
self.diffuse = [.8, .8, .8, 1.]
self.ambient = [.2, .2, .2, 1.]
self.specular = [0., 0., 0., 1.]
self.emissi... | true | true |
f72bd8c09290fd4650b93bed148f010025633ae2 | 5,361 | py | Python | hla_hed.py | sunhuaibo/HLA-HED | bb0672e62a20baad80f5f154c9220bf8e5b8b28c | [
"MIT"
] | null | null | null | hla_hed.py | sunhuaibo/HLA-HED | bb0672e62a20baad80f5f154c9220bf8e5b8b28c | [
"MIT"
] | null | null | null | hla_hed.py | sunhuaibo/HLA-HED | bb0672e62a20baad80f5f154c9220bf8e5b8b28c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding=utf-8 -*-
# =====================================
# Author: Huaibo Sun
# E-mail: huaibo_sun@foxmail.com
# date: 2022-03-31
# =====================================
import os
import pandas as pd
from Bio import SeqIO
from pathlib import Path
from itertools import combinations
from a... | 39.711111 | 312 | 0.610707 |
import os
import pandas as pd
from Bio import SeqIO
from pathlib import Path
from itertools import combinations
from argparse import ArgumentParser, RawDescriptionHelpFormatter
def get_opt():
script = os.path.dirname(os.path.abspath(__file__))
parser = ArgumentParser(formatter_class=RawDescriptionHelpFo... | true | true |
f72bd93c4d17e05aa0d2db88c1b2ffb816c8ad18 | 2,936 | py | Python | sdk/monitor/azure-monitor-query/setup.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/monitor/azure-monitor-query/setup.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/monitor/azure-monitor-query/setup.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#----------------------------------------------------------------... | 33.363636 | 85 | 0.609673 |
import re
import os.path
from io import open
from setuptools import find_packages, setup
PACKAGE_NAME = "azure-monitor-query"
PACKAGE_PPRINT_NAME = "Azure Monitor Query"
package_folder_path = PACKAGE_NAME.replace('-', '/')
namespace_name = PACKAGE_NAME.replace('-', '.')
try:
import azure
try:
ver =... | true | true |
f72bd93f9a0200f463455bbe0367f69059d57081 | 1,045 | py | Python | src/serialize_tree.py | kemingy/daily-coding-problem | 0839311ec0848f8f0b4a9edba817ecceb8f944a0 | [
"Unlicense"
] | 3 | 2019-03-06T03:14:56.000Z | 2020-01-07T16:00:48.000Z | src/serialize_tree.py | kemingy/daily-coding-problem | 0839311ec0848f8f0b4a9edba817ecceb8f944a0 | [
"Unlicense"
] | null | null | null | src/serialize_tree.py | kemingy/daily-coding-problem | 0839311ec0848f8f0b4a9edba817ecceb8f944a0 | [
"Unlicense"
] | null | null | null | # Given the root to a binary tree, implement serialize(root), which serializes
# the tree into a string, and deserialize(s), which deserializes the string back
# into the tree.
class Node:
def __init__(self, val, left=None, right=None):
self.val = val
self.left = left
self.right ... | 25.487805 | 89 | 0.579904 |
class Node:
def __init__(self, val, left=None, right=None):
self.val = val
self.left = left
self.right = right
def serialize(node):
ans = []
level = [node]
while level:
children = []
for n in level:
if n:
children.ap... | true | true |
f72bd97572c539099427f5e9007176593b7fce2c | 470 | py | Python | test_project/views/response_types/http_redirect.py | korantu/lona | 5039fa59f37cc32b9c789753af2ed8a8670ab611 | [
"MIT"
] | 230 | 2021-08-15T20:46:24.000Z | 2022-03-30T10:17:43.000Z | test_project/views/response_types/http_redirect.py | korantu/lona | 5039fa59f37cc32b9c789753af2ed8a8670ab611 | [
"MIT"
] | 176 | 2021-08-18T08:19:37.000Z | 2022-03-29T16:45:06.000Z | test_project/views/response_types/http_redirect.py | korantu/lona | 5039fa59f37cc32b9c789753af2ed8a8670ab611 | [
"MIT"
] | 13 | 2021-08-20T10:35:04.000Z | 2022-01-17T15:49:40.000Z | from lona.html import Strong, Div, H2, P
from lona.view import LonaView
class HTTPRedirectView(LonaView):
def handle_request(self, request):
s = Strong()
html = Div(
H2('Redirect'),
P('You will be HTTP redirected in ', s, ' seconds'),
)
for i in [3, 2, 1]:... | 19.583333 | 64 | 0.497872 | from lona.html import Strong, Div, H2, P
from lona.view import LonaView
class HTTPRedirectView(LonaView):
def handle_request(self, request):
s = Strong()
html = Div(
H2('Redirect'),
P('You will be HTTP redirected in ', s, ' seconds'),
)
for i in [3, 2, 1]:... | true | true |
f72bd9dea41c09da28f2a59df1bc45565df5f22d | 1,064 | py | Python | products/migrations/0003_reviews.py | ankit-ak/django-ecommerce-1 | 248127526c03c7c0f25a2df84365a0d0199b9693 | [
"MIT"
] | 4 | 2021-04-06T16:50:57.000Z | 2022-03-02T00:50:44.000Z | products/migrations/0003_reviews.py | ankit-ak/django-ecommerce-1 | 248127526c03c7c0f25a2df84365a0d0199b9693 | [
"MIT"
] | null | null | null | products/migrations/0003_reviews.py | ankit-ak/django-ecommerce-1 | 248127526c03c7c0f25a2df84365a0d0199b9693 | [
"MIT"
] | 7 | 2021-02-22T08:07:20.000Z | 2022-03-06T10:17:28.000Z | # Generated by Django 2.2.11 on 2020-04-01 18:44
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('products', '0002_auto_2... | 39.407407 | 166 | 0.631579 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('products', '0002_auto_20200314_0741'),
]
operations = [
... | true | true |
f72bda1f9861b327f93273a74d2beaf0c1884dd9 | 1,026 | py | Python | INBa/2015/Sarocvashin_M/task_4_23.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Sarocvashin_M/task_4_23.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Sarocvashin_M/task_4_23.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 4. Вариант 23
# Напишите программу, которая выводит имя, под которым скрывается Илья Арнольдович Файзильберг. Дополнительно необходимо вывести область интересов указанной личности, место рождения, годы рождения и смерти (если человек умер), вычислить возраст на данный момент (или момент смерти). Для хранения в... | 46.636364 | 449 | 0.783626 |
name = "Илья Арнольдович Файзильберг"
birthplace = "Одесса,СССР"
birthyear = int (1897)
deathyear = int (1937)
age = int (deathyear - birthyear)
interest = "Писатель"
print(name+" наиболее известен как Илья Ильф - русский советский писатель, журналист и сценарист. Соавтор Евгения Петрова")
print("Место рождения: "... | true | true |
f72bdb03716d1c420cd5c2e0dab725ff70c1358a | 8,629 | py | Python | src/python3/sdp/math/interpolation.py | LeiShi/Synthetic-Diagnostics-Platform | 870120d3fd14b2a3c89c6e6e85625d1e9109a2de | [
"BSD-3-Clause"
] | 5 | 2019-08-16T22:08:19.000Z | 2021-02-24T02:47:05.000Z | src/python3/sdp/math/interpolation.py | justthepython/Synthetic-Diagnostics-Platform | 5f1cb5c29d182490acbd4f3c167f0e09ec211236 | [
"BSD-3-Clause"
] | 1 | 2016-05-11T12:58:00.000Z | 2016-05-11T17:18:36.000Z | src/python3/sdp/math/interpolation.py | justthepython/Synthetic-Diagnostics-Platform | 5f1cb5c29d182490acbd4f3c167f0e09ec211236 | [
"BSD-3-Clause"
] | 5 | 2018-04-29T12:35:59.000Z | 2020-01-10T03:38:30.000Z | """This module contains some useful interpolation methods
"""
import numpy as np
from scipy.interpolate import BarycentricInterpolator
class InterpolationError(Exception):
def __init__(self,value):
self.value = value
def __str__(self):
return repr(self.value)
class OutofBoundError(Interpolati... | 40.70283 | 565 | 0.585004 |
import numpy as np
from scipy.interpolate import BarycentricInterpolator
class InterpolationError(Exception):
def __init__(self,value):
self.value = value
def __str__(self):
return repr(self.value)
class OutofBoundError(InterpolationError, ValueError):
def __init__(self, value):
s... | true | true |
f72bdb07358bd565efec3e28ef5e0ed2041de357 | 7,081 | py | Python | cla-backend/cla/tests/unit/test_user_event.py | tejasadg/easycla | 12284c957ab543d0d09c63aa8e82d70ecf09ccaf | [
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | null | null | null | cla-backend/cla/tests/unit/test_user_event.py | tejasadg/easycla | 12284c957ab543d0d09c63aa8e82d70ecf09ccaf | [
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | null | null | null | cla-backend/cla/tests/unit/test_user_event.py | tejasadg/easycla | 12284c957ab543d0d09c63aa8e82d70ecf09ccaf | [
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | null | null | null | # Copyright The Linux Foundation and each contributor to CommunityBridge.
# SPDX-License-Identifier: MIT
from unittest.mock import patch, Mock
import unittest
import pytest
from cla.models.dynamo_models import User, Project, Company, CCLAWhitelistRequest
from cla.models.event_types import EventType
from cla.controll... | 41.168605 | 102 | 0.656263 |
from unittest.mock import patch, Mock
import unittest
import pytest
from cla.models.dynamo_models import User, Project, Company, CCLAWhitelistRequest
from cla.models.event_types import EventType
from cla.controllers import user as user_controller
from cla.auth import AuthUser
@pytest.fixture
def create_event_user(... | true | true |
f72bdc7b9355d16ea5ca646e0db1ca2a4c402827 | 5,135 | py | Python | win_unc/unc_directory.py | zo-edv/py_win_unc | 610b7c9ce4ea17554d04342126169b488c8ccfae | [
"MIT"
] | 10 | 2015-08-14T06:34:28.000Z | 2020-10-03T17:48:09.000Z | win_unc/unc_directory.py | zo-edv/py_win_unc | 610b7c9ce4ea17554d04342126169b488c8ccfae | [
"MIT"
] | 11 | 2017-01-12T23:43:56.000Z | 2020-06-19T18:32:56.000Z | win_unc/unc_directory.py | zo-edv/py_win_unc | 610b7c9ce4ea17554d04342126169b488c8ccfae | [
"MIT"
] | 8 | 2015-09-25T20:44:33.000Z | 2018-10-04T03:19:42.000Z | from win_unc.errors import InvalidUncPathError
from win_unc.cleaners import clean_unc_path
from win_unc.unc_credentials import get_creds_from_string
from win_unc.validators import is_valid_unc_path
class UncDirectory(object):
"""
Represents a UNC directory on Windows. A UNC directory is a path and optionally ... | 37.481752 | 98 | 0.637196 | from win_unc.errors import InvalidUncPathError
from win_unc.cleaners import clean_unc_path
from win_unc.unc_credentials import get_creds_from_string
from win_unc.validators import is_valid_unc_path
class UncDirectory(object):
def __init__(self, path, creds=None):
if creds is None and isinstance(path, Un... | true | true |
f72bdee1d28143d175cb1971a290684cad30cafc | 479 | py | Python | Code/sentiment_analysis.py | mayureeb/fakenews | c47a72c8bbe4d413b309da0c662da784c002fe3f | [
"Unlicense"
] | 12 | 2017-06-25T23:06:31.000Z | 2021-02-27T23:06:57.000Z | Code/sentiment_analysis.py | mayureeb/fakenews | c47a72c8bbe4d413b309da0c662da784c002fe3f | [
"Unlicense"
] | 6 | 2021-03-31T20:03:11.000Z | 2022-03-12T00:49:42.000Z | Code/sentiment_analysis.py | mayureeb/fakenews | c47a72c8bbe4d413b309da0c662da784c002fe3f | [
"Unlicense"
] | 5 | 2017-06-25T23:05:41.000Z | 2018-11-22T16:10:58.000Z | import pandas as pd
from textblob import TextBlob
pd.options.mode.chained_assignment = None # ignores the SettingWithCopy Warning
df = pd.read_csv('INPUT.csv', encoding = 'utf8')
df['polarity'] = 0.0
df['subjectivity'] = 0.0
for i in range(0, len(df.index)):
print(i)
blob = TextBlob(str(df['text'][i]))
df... | 29.9375 | 80 | 0.691023 | import pandas as pd
from textblob import TextBlob
pd.options.mode.chained_assignment = None df = pd.read_csv('INPUT.csv', encoding = 'utf8')
df['polarity'] = 0.0
df['subjectivity'] = 0.0
for i in range(0, len(df.index)):
print(i)
blob = TextBlob(str(df['text'][i]))
df['subjectivity'][i] = blob.sentiment.s... | true | true |
f72bdf31e9017fd309d269003029962f0606f6e1 | 22,621 | py | Python | client.py | iegorman/netspeed | 6eec201791b89be69ed9d6a6563d90cf324f2f14 | [
"BSD-2-Clause"
] | null | null | null | client.py | iegorman/netspeed | 6eec201791b89be69ed9d6a6563d90cf324f2f14 | [
"BSD-2-Clause"
] | null | null | null | client.py | iegorman/netspeed | 6eec201791b89be69ed9d6a6563d90cf324f2f14 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python3
# Connmand line client for repeated internet speed tests.
import os
import sys
import collections
import gc
import getopt
import json
import math
import time
import traceback
import urllib.error
import urllib.request
import re
class Client(object):
"""
Python class and connmand line client ... | 41.582721 | 79 | 0.55895 |
import os
import sys
import collections
import gc
import getopt
import json
import math
import time
import traceback
import urllib.error
import urllib.request
import re
class Client(object):
defaultInterval = 3_600 initialDownloadLength = 20_000_000 initialUploadLength = 2_000_000 ... | true | true |
f72be1dc6f4fb1ba0ced9f2acbb93db31ef858b3 | 3,694 | py | Python | bin/specsim3d/spectralsim.py | LutzGross/fingal | 4b6fcc02871e7ba1a98f37ffd18f1a16a5fe6a48 | [
"Apache-2.0"
] | null | null | null | bin/specsim3d/spectralsim.py | LutzGross/fingal | 4b6fcc02871e7ba1a98f37ffd18f1a16a5fe6a48 | [
"Apache-2.0"
] | null | null | null | bin/specsim3d/spectralsim.py | LutzGross/fingal | 4b6fcc02871e7ba1a98f37ffd18f1a16a5fe6a48 | [
"Apache-2.0"
] | null | null | null | #-------------------------------------------------------------------------------
# Name: Spectralsim
# Purpose: Simulation of standard normal random fields
#
# Author: Dr.-Ing. S. Hoerning
#
# Created: 02.05.2018, Centre for Natural Gas, EAIT,
# The University of Quee... | 35.864078 | 84 | 0.538711 |
import numpy as np
from . import covariancefunction as covfun
class spectral_random_field(object):
def __init__(self,
domainsize = (100,100),
covmod = '1.0 Exp(2.)',
periodic = False,
):
self.counter = 0
self.... | true | true |
f72be3f57c7c5d2eb4ce80ae2f2640c917c82222 | 1,598 | py | Python | salt/states/aptpkg.py | preoctopus/salt | aceaaa0e2f2f2ff29a694393bd82bba0d88fa44d | [
"Apache-2.0"
] | 3 | 2015-04-16T18:42:35.000Z | 2017-10-30T16:57:49.000Z | salt/states/aptpkg.py | preoctopus/salt | aceaaa0e2f2f2ff29a694393bd82bba0d88fa44d | [
"Apache-2.0"
] | 16 | 2015-11-18T00:44:03.000Z | 2018-10-29T20:48:27.000Z | salt/states/aptpkg.py | preoctopus/salt | aceaaa0e2f2f2ff29a694393bd82bba0d88fa44d | [
"Apache-2.0"
] | 4 | 2020-11-04T06:28:05.000Z | 2022-02-09T10:54:49.000Z | # -*- coding: utf-8 -*-
'''
Package management operations specific to APT- and DEB-based systems
====================================================================
'''
from __future__ import absolute_import
# Import python libs
import logging
# Import salt libs
import salt.utils
log = logging.getLogger(__name__)
... | 27.084746 | 76 | 0.560701 | from __future__ import absolute_import
import logging
import salt.utils
log = logging.getLogger(__name__)
__virtualname__ = 'apt'
def __virtual__():
return (__virtualname__
if __salt__.get('pkg.get_selections', False)
else False)
def held(name):
ret = {'name': name, 'changes': {... | true | true |
f72be4c5cc1eeab06b7191f01eab65ac00eda171 | 605 | py | Python | lms_aaditya/ContactsModules/update_contacts.py | hcmuleva/personal-profile | 051b5a2f36b927951691f48abe584beb8bc25440 | [
"MIT"
] | null | null | null | lms_aaditya/ContactsModules/update_contacts.py | hcmuleva/personal-profile | 051b5a2f36b927951691f48abe584beb8bc25440 | [
"MIT"
] | 3 | 2020-07-13T17:46:32.000Z | 2020-07-26T10:30:59.000Z | lms_aaditya/ContactsModules/update_contacts.py | hcmuleva/personal-profile | 051b5a2f36b927951691f48abe584beb8bc25440 | [
"MIT"
] | null | null | null | from MongoConnect import ConnectModule
my_con = ConnectModule.connect()
collection = my_con.db["Contacts"]
class UpdateContact:
def __init__(self, reg_id, uname, uemail, uphone):
self.uname = uname
self.uemail = uemail
self.uphone = uphone
self.reg_id = reg_id
def update(self)... | 27.5 | 75 | 0.58843 | from MongoConnect import ConnectModule
my_con = ConnectModule.connect()
collection = my_con.db["Contacts"]
class UpdateContact:
def __init__(self, reg_id, uname, uemail, uphone):
self.uname = uname
self.uemail = uemail
self.uphone = uphone
self.reg_id = reg_id
def update(self)... | true | true |
f72be53c78ed7ddbde3083e7ebead947d18b09a5 | 2,494 | py | Python | dayong/components/event_component.py | ooliver1/Dayong | 0923e0ff2a03157a51f7fae9c6056afd812c314c | [
"MIT"
] | 1 | 2021-11-04T13:20:31.000Z | 2021-11-04T13:20:31.000Z | dayong/components/event_component.py | ooliver1/Dayong | 0923e0ff2a03157a51f7fae9c6056afd812c314c | [
"MIT"
] | null | null | null | dayong/components/event_component.py | ooliver1/Dayong | 0923e0ff2a03157a51f7fae9c6056afd812c314c | [
"MIT"
] | null | null | null | """
dayong.components.event_component
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Organization of events and event listeners.
"""
from typing import Optional
import hikari
import tanjun
from dayong.configs import DayongConfig
component = tanjun.Component()
@component.with_listener(hikari.MemberCreateEvent)
async def greet_... | 30.048193 | 87 | 0.623897 | from typing import Optional
import hikari
import tanjun
from dayong.configs import DayongConfig
component = tanjun.Component()
@component.with_listener(hikari.MemberCreateEvent)
async def greet_new_member(
event: hikari.MemberCreateEvent,
config: DayongConfig = tanjun.injected(type=DayongConfig),
) -> None... | true | true |
f72be60e09156efc269b07d9431ebb692d7f5e1c | 683 | py | Python | src/test_SimulationState.py | pawel00100/Disease-Spread-Simulation | eff8b824a9205f61a4d70cd6c7613a9a786bd1eb | [
"MIT"
] | null | null | null | src/test_SimulationState.py | pawel00100/Disease-Spread-Simulation | eff8b824a9205f61a4d70cd6c7613a9a786bd1eb | [
"MIT"
] | null | null | null | src/test_SimulationState.py | pawel00100/Disease-Spread-Simulation | eff8b824a9205f61a4d70cd6c7613a9a786bd1eb | [
"MIT"
] | null | null | null | from unittest import TestCase
from Person import Person
from SimulationState import SimulationState, MapPosition
from src.Map import Map
class TestSimulationState(TestCase):
def test_find_neighbors(self):
map = Map(200, 200)
p0 = Person(MapPosition(0, 0, map), map)
p1 = Person(MapPositio... | 31.045455 | 103 | 0.676428 | from unittest import TestCase
from Person import Person
from SimulationState import SimulationState, MapPosition
from src.Map import Map
class TestSimulationState(TestCase):
def test_find_neighbors(self):
map = Map(200, 200)
p0 = Person(MapPosition(0, 0, map), map)
p1 = Person(MapPositio... | true | true |
f72be711d81d043cbb81c0c2790bd4ca458ffcbf | 3,130 | py | Python | tests/test_types.py | acarrasco/dacite | ece070cc3c25e86634086db8ee4f2e45bdfe6fe5 | [
"MIT"
] | null | null | null | tests/test_types.py | acarrasco/dacite | ece070cc3c25e86634086db8ee4f2e45bdfe6fe5 | [
"MIT"
] | 1 | 2019-03-20T17:30:34.000Z | 2019-03-20T17:30:34.000Z | tests/test_types.py | acarrasco/dacite | ece070cc3c25e86634086db8ee4f2e45bdfe6fe5 | [
"MIT"
] | null | null | null | from typing import Optional, Union, List, Any, Dict, NewType, TypeVar, Generic
import pytest
from dacite.types import (
is_optional,
extract_optional,
is_generic,
is_union,
is_generic_collection,
extract_origin_collection,
is_instance,
cast_value,
extract_generic,
is_new_type,
... | 22.517986 | 78 | 0.763259 | from typing import Optional, Union, List, Any, Dict, NewType, TypeVar, Generic
import pytest
from dacite.types import (
is_optional,
extract_optional,
is_generic,
is_union,
is_generic_collection,
extract_origin_collection,
is_instance,
cast_value,
extract_generic,
is_new_type,
... | true | true |
f72be79b665283eb1a3552b5a050e1fc7b15727e | 2,877 | py | Python | mms/context.py | andrewfayres/mxnet-model-server | ef4edfef4cfe5234887bf834ec7b82676a36ba02 | [
"Apache-2.0"
] | 1 | 2019-01-30T02:57:31.000Z | 2019-01-30T02:57:31.000Z | mms/context.py | DrSnowbird/mxnet-model-server | a0bfd712350545dceb21c8e0b0b21dfa0c9918a7 | [
"Apache-2.0"
] | null | null | null | mms/context.py | DrSnowbird/mxnet-model-server | a0bfd712350545dceb21c8e0b0b21dfa0c9918a7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
# http://www.apache.org/licenses/LICENSE-2.0
# or in the "license" file... | 31.271739 | 90 | 0.686827 |
class Context(object):
def __init__(self, model_name, model_dir, manifest, batch_size, gpu, mms_version):
self.model_name = model_name
self.manifest = manifest
self._system_properties = {
"model_dir": model_dir,
"gpu_id": gpu,
"batch_size": batch_size,... | true | true |
f72be81e9dc0fedf810a47adb40ea90cbd01bd08 | 7,766 | py | Python | xos/core/dashboard/views/home.py | pan2za/xos | c2a4da2ccaa12360b2718be303b247866aefdfe6 | [
"Apache-2.0"
] | null | null | null | xos/core/dashboard/views/home.py | pan2za/xos | c2a4da2ccaa12360b2718be303b247866aefdfe6 | [
"Apache-2.0"
] | 5 | 2020-06-05T17:47:15.000Z | 2021-09-23T23:21:27.000Z | xos/core/dashboard/views/home.py | pan2za/xos | c2a4da2ccaa12360b2718be303b247866aefdfe6 | [
"Apache-2.0"
] | null | null | null | from view_common import *
from django.http import HttpResponseRedirect
import sys
def isInt(s):
try:
int(s)
return True
except ValueError:
return False
class LoggedInView(TemplateView):
def get(self, request, name="root", *args, **kwargs):
if request.user.login_page:
... | 37.882927 | 160 | 0.550992 | from view_common import *
from django.http import HttpResponseRedirect
import sys
def isInt(s):
try:
int(s)
return True
except ValueError:
return False
class LoggedInView(TemplateView):
def get(self, request, name="root", *args, **kwargs):
if request.user.login_page:
... | true | true |
f72be85a54f072db1fb3df347bed8b5574b5043c | 3,782 | py | Python | fn_task_utils/fn_task_utils/components/task_utils_close_task.py | nickpartner-goahead/resilient-community-apps | 097c0dbefddbd221b31149d82af9809420498134 | [
"MIT"
] | 65 | 2017-12-04T13:58:32.000Z | 2022-03-24T18:33:17.000Z | fn_task_utils/fn_task_utils/components/task_utils_close_task.py | nickpartner-goahead/resilient-community-apps | 097c0dbefddbd221b31149d82af9809420498134 | [
"MIT"
] | 48 | 2018-03-02T19:17:14.000Z | 2022-03-09T22:00:38.000Z | fn_task_utils/fn_task_utils/components/task_utils_close_task.py | nickpartner-goahead/resilient-community-apps | 097c0dbefddbd221b31149d82af9809420498134 | [
"MIT"
] | 95 | 2018-01-11T16:23:39.000Z | 2022-03-21T11:34:29.000Z | # -*- coding: utf-8 -*-
# Copyright © IBM Corporation 2010, 2019
# pragma pylint: disable=unused-argument, no-self-use
"""Function implementation"""
import logging
from resilient_circuits import ResilientComponent, function, handler, StatusMessage, FunctionResult, FunctionError
from resilient_lib import ResultPayload
... | 41.56044 | 119 | 0.608673 |
import logging
from resilient_circuits import ResilientComponent, function, handler, StatusMessage, FunctionResult, FunctionError
from resilient_lib import ResultPayload
from fn_task_utils.lib.task_common import find_task_by_name, get_function_input
class FunctionComponent(ResilientComponent):
def __init__(self... | true | true |
f72be963c795ad4620dda7b2f24b5d80e2f23382 | 8,139 | py | Python | tests/test_templates.py | eon01/wagtail-metadata | 583968b67157ac7944631966919b523674568141 | [
"BSD-3-Clause"
] | null | null | null | tests/test_templates.py | eon01/wagtail-metadata | 583968b67157ac7944631966919b523674568141 | [
"BSD-3-Clause"
] | null | null | null | tests/test_templates.py | eon01/wagtail-metadata | 583968b67157ac7944631966919b523674568141 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from django.forms.utils import flatatt
from django.template import TemplateSyntaxError, engines
from django.test import RequestFactory, TestCase, override_settings
from django.utils.html import format_html
from wagtail.core.models import Site
from wagtail.images.models import Image
from wagtai... | 34.341772 | 120 | 0.621207 |
from django.forms.utils import flatatt
from django.template import TemplateSyntaxError, engines
from django.test import RequestFactory, TestCase, override_settings
from django.utils.html import format_html
from wagtail.core.models import Site
from wagtail.images.models import Image
from wagtail.images.tests.utils imp... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.