hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | 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 209 | max_issues_repo_name stringlengths 5 121 | 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 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6d82f1dc44e1d30ecde518756438009dc45d52ed | 3,707 | py | Python | memn2n_pytorch.py | dehuachen/mem_cnn_sim | 3262a9b607a5aafccbe4e5a665e74a7cde926da3 | [
"MIT"
] | null | null | null | memn2n_pytorch.py | dehuachen/mem_cnn_sim | 3262a9b607a5aafccbe4e5a665e74a7cde926da3 | [
"MIT"
] | null | null | null | memn2n_pytorch.py | dehuachen/mem_cnn_sim | 3262a9b607a5aafccbe4e5a665e74a7cde926da3 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
from torch.autograd import Variable
from torch import optim
class MemN2NDialog(nn.Module):
"""docstring for MemN2NDialog"""
def __init__(self, batch_size, vocab_size, candidates_size, sentence_size, embedding_size,
candidates_vec,
hops=3,
... | 32.517544 | 94 | 0.612355 |
a8938465f2e17465b1b5e0fbfa82d07155bb8331 | 32,292 | py | Python | framework/Models/PostProcessors/EconomicRatio.py | FlanFlanagan/raven | bd7fca18af94376a28e2144ba1da72c01c8d343c | [
"Apache-2.0"
] | 1 | 2022-03-10T18:54:09.000Z | 2022-03-10T18:54:09.000Z | framework/Models/PostProcessors/EconomicRatio.py | FlanFlanagan/raven | bd7fca18af94376a28e2144ba1da72c01c8d343c | [
"Apache-2.0"
] | null | null | null | framework/Models/PostProcessors/EconomicRatio.py | FlanFlanagan/raven | bd7fca18af94376a28e2144ba1da72c01c8d343c | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Battelle Energy Alliance, 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 t... | 47.488235 | 209 | 0.624551 |
f357564b77575c5a647546705aff8b2dc46a50b1 | 4,180 | py | Python | tests/api/conftest.py | Drakulix/knex | ab71c243e105b978ad1a3c1879ec1c8eb15e51b3 | [
"MIT"
] | 7 | 2017-05-24T14:25:24.000Z | 2017-08-19T11:04:11.000Z | tests/api/conftest.py | Drakulix/knex | ab71c243e105b978ad1a3c1879ec1c8eb15e51b3 | [
"MIT"
] | 302 | 2017-05-10T10:42:55.000Z | 2017-09-26T18:47:42.000Z | tests/api/conftest.py | Drakulix/knex | ab71c243e105b978ad1a3c1879ec1c8eb15e51b3 | [
"MIT"
] | 7 | 2017-05-11T21:05:11.000Z | 2017-07-27T13:28:51.000Z | import json
import os
import docker
import pytest
import requests
from os.path import abspath, dirname
from jsonschema import Draft4Validator, FormatChecker
from pymongo import MongoClient
@pytest.fixture(scope='session')
def docker_client():
"""
to run this properly you have to install pypiwin32 if you are ... | 31.428571 | 89 | 0.648565 |
90b7b2f49ad7c2ace0061fab594f4afddd97a675 | 3,863 | py | Python | drfx/apps/usermgmt/models.py | amarshukla/DRF-CustomUser-AuthToken | a19e8c963d9ef4ad5e8359556f0212ca60995a42 | [
"MIT"
] | null | null | null | drfx/apps/usermgmt/models.py | amarshukla/DRF-CustomUser-AuthToken | a19e8c963d9ef4ad5e8359556f0212ca60995a42 | [
"MIT"
] | null | null | null | drfx/apps/usermgmt/models.py | amarshukla/DRF-CustomUser-AuthToken | a19e8c963d9ef4ad5e8359556f0212ca60995a42 | [
"MIT"
] | null | null | null | from django.contrib.auth.models import (
BaseUserManager, AbstractBaseUser
)
from django.core.validators import RegexValidator
from django.db import models
class UserManager(BaseUserManager):
def create_user(self, username, email, password=None):
"""
Creates and saves a User with the given ema... | 29.48855 | 88 | 0.580637 |
d61ff9517b38ca3afa2a1650ad0c0ae91489f9c7 | 1,796 | py | Python | resources/lib/film.py | joha73/plugin.video.mediathekview | 8cfccdc621d4db097066ca6952598cb4bffb6dd5 | [
"MIT"
] | null | null | null | resources/lib/film.py | joha73/plugin.video.mediathekview | 8cfccdc621d4db097066ca6952598cb4bffb6dd5 | [
"MIT"
] | null | null | null | resources/lib/film.py | joha73/plugin.video.mediathekview | 8cfccdc621d4db097066ca6952598cb4bffb6dd5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
The film model module
Copyright 2017-2019, Leo Moll and Dominik Schlösser
Licensed under MIT License
"""
class Film(object):
""" The film model class """
def __init__(self):
self.filmid = 0
self.title = ''
self.show = ''
self.channel = ''
s... | 29.933333 | 56 | 0.52784 |
8f3ee518e20bc01de6f9102a2d5ee1f6bd6b1cdb | 23,109 | py | Python | pylogix/lgx_comm.py | xandrade/pylogix | 05efa5a5b2c727736cd43fa6085e8f40c9ae1a1a | [
"Apache-2.0"
] | null | null | null | pylogix/lgx_comm.py | xandrade/pylogix | 05efa5a5b2c727736cd43fa6085e8f40c9ae1a1a | [
"Apache-2.0"
] | null | null | null | pylogix/lgx_comm.py | xandrade/pylogix | 05efa5a5b2c727736cd43fa6085e8f40c9ae1a1a | [
"Apache-2.0"
] | null | null | null | """
Copyright 2021 Dustin Roeder (dmroeder@gmail.com)
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... | 32.547887 | 97 | 0.503224 |
c0f6a42bbcd2463e71629b0db048e2b7b4b26976 | 2,299 | py | Python | pid_contoller/pid_controller/loop.py | matthaeusheer/playground | 407086c8070cf71280b426db61fbe03034283760 | [
"MIT"
] | null | null | null | pid_contoller/pid_controller/loop.py | matthaeusheer/playground | 407086c8070cf71280b426db61fbe03034283760 | [
"MIT"
] | 1 | 2020-11-14T09:42:28.000Z | 2020-11-14T09:42:28.000Z | pid_contoller/pid_controller/loop.py | matthaeusheer/playground | 407086c8070cf71280b426db61fbe03034283760 | [
"MIT"
] | null | null | null | from pid_controller.controller import PidController, System, Sensor, ErrorSignal, MassSystem
from typing import Generator, Tuple
def closed_loop(system: System, controller: PidController, sensor: Sensor,
desired_state: float, eps: float = 0.01, delta_time: float = 0.1,
max_time: float... | 38.966102 | 119 | 0.695085 |
31c53e2f77441c4453096592f03735fee94edb7c | 327 | py | Python | training/migrations/0002_remove_training_training_type.py | linikerunk/tcc-people-analytics | fdda975682d5299c8384e31ebb974dc085330875 | [
"MIT"
] | null | null | null | training/migrations/0002_remove_training_training_type.py | linikerunk/tcc-people-analytics | fdda975682d5299c8384e31ebb974dc085330875 | [
"MIT"
] | 1 | 2020-10-11T10:09:39.000Z | 2020-10-11T10:09:39.000Z | training/migrations/0002_remove_training_training_type.py | linikerunk/TCC_PeopleAnalytics | fdda975682d5299c8384e31ebb974dc085330875 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.5 on 2020-09-16 20:53
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('training', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='training',
name='training_type',
),... | 18.166667 | 47 | 0.590214 |
9a2858dec4bf9c2c3724b6962b6cf7ef57c21d57 | 432 | py | Python | env/Lib/site-packages/plotly/validators/layout/yaxis/_showdividers.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | venv/Lib/site-packages/plotly/validators/layout/yaxis/_showdividers.py | wakisalvador/constructed-misdirection | 74779e9ec640a11bc08d5d1967c85ac4fa44ea5e | [
"Unlicense"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | venv/Lib/site-packages/plotly/validators/layout/yaxis/_showdividers.py | wakisalvador/constructed-misdirection | 74779e9ec640a11bc08d5d1967c85ac4fa44ea5e | [
"Unlicense"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class ShowdividersValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self, plotly_name="showdividers", parent_name="layout.yaxis", **kwargs
):
super(ShowdividersValidator, self).__init__(
plotly_name=plotly_name,
... | 30.857143 | 78 | 0.666667 |
7bfdabefa3bd818df619ca3ff1ece69b011f5b8a | 891 | py | Python | Perforce/MayaUtils.py | TomMinor/MayaPerforce | 52182c7e5c3e91e41973d0c2abbda8880e809e49 | [
"MIT"
] | 13 | 2017-03-31T21:52:19.000Z | 2021-09-06T23:15:30.000Z | Perforce/MayaUtils.py | TomMinor/MayaPerforce | 52182c7e5c3e91e41973d0c2abbda8880e809e49 | [
"MIT"
] | 3 | 2017-05-08T02:27:43.000Z | 2017-05-10T03:20:11.000Z | Perforce/MayaUtils.py | TomMinor/MayaPerforce | 52182c7e5c3e91e41973d0c2abbda8880e809e49 | [
"MIT"
] | 3 | 2017-05-05T14:03:03.000Z | 2020-05-25T10:25:04.000Z | import os
import logging
# import maya.mel
# import maya.utils as mu
import maya.cmds as cmds
import maya.OpenMayaUI as omui
from shiboken import wrapInstance
# from PySide import QtCore
from PySide import QtGui
import GlobalVars
reload(GlobalVars)
# Todo: Make these Utils things a class?
p4_logger = logging.getLo... | 20.25 | 78 | 0.747475 |
34977a813d6c3189fac0b88fefa87fa2487dae15 | 1,355 | py | Python | ckanext/digitalwallonia/plugin.py | pduchesne/ckanext-digitalwallonia | a4cb03f044e628e6f5ee8bfe213e484892ad5564 | [
"CC0-1.0"
] | null | null | null | ckanext/digitalwallonia/plugin.py | pduchesne/ckanext-digitalwallonia | a4cb03f044e628e6f5ee8bfe213e484892ad5564 | [
"CC0-1.0"
] | null | null | null | ckanext/digitalwallonia/plugin.py | pduchesne/ckanext-digitalwallonia | a4cb03f044e628e6f5ee8bfe213e484892ad5564 | [
"CC0-1.0"
] | null | null | null | '''plugin.py
'''
import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
import ckan.plugins as p
from ckanext.spatial.interfaces import ISpatialHarvester
from ckan.common import json
class ADNThemePlugin(plugins.SingletonPlugin):
'''ADN theme plugin.
'''
# Declare that this class implemen... | 33.04878 | 85 | 0.707011 |
498a0171abe390add4af6be162dfbe37c674930a | 1,040 | py | Python | demos/polls/setup.py | tumb1er/aiohttp | 072991f879a8d59f30ff80779a14ca3273f3a750 | [
"Apache-2.0"
] | 1 | 2019-09-18T19:40:30.000Z | 2019-09-18T19:40:30.000Z | demos/polls/setup.py | tumb1er/aiohttp | 072991f879a8d59f30ff80779a14ca3273f3a750 | [
"Apache-2.0"
] | 3 | 2019-09-19T19:00:38.000Z | 2019-09-20T09:56:49.000Z | demos/polls/setup.py | tumb1er/aiohttp | 072991f879a8d59f30ff80779a14ca3273f3a750 | [
"Apache-2.0"
] | 1 | 2020-01-17T00:33:59.000Z | 2020-01-17T00:33:59.000Z | import os
import re
from setuptools import find_packages, setup
def read_version():
regexp = re.compile(r"^__version__\W*=\W*'([\d.abrc]+)'")
init_py = os.path.join(os.path.dirname(__file__),
'aiohttpdemo_polls', '__init__.py')
with open(init_py) as f:
for line in f:
... | 27.368421 | 72 | 0.570192 |
7071c2dee7ffc17841b958066a4b4c15ff265358 | 2,412 | py | Python | nlweb/api/management/commands/testapi.py | WHOIGit/nes-lter-ims | d4cc96c10da56ca33286af84d669625b67170522 | [
"MIT"
] | 3 | 2019-01-24T16:32:50.000Z | 2021-11-05T02:18:12.000Z | nlweb/api/management/commands/testapi.py | WHOIGit/nes-lter-ims | d4cc96c10da56ca33286af84d669625b67170522 | [
"MIT"
] | 45 | 2019-05-23T15:15:32.000Z | 2022-03-15T14:09:20.000Z | nlweb/api/management/commands/testapi.py | WHOIGit/nes-lter-ims | d4cc96c10da56ca33286af84d669625b67170522 | [
"MIT"
] | null | null | null | import requests
from django.core.management.base import BaseCommand, CommandError
class HttpError(Exception):
def __init__(self, code, url, message='HTTP error returned'):
self.code = code
self.url = url
self.message = message
super().__init__(self, message)
class Command(BaseCo... | 29.414634 | 81 | 0.582504 |
1328e4d51ed28218b2833a34b4905b32b7a04a63 | 6,511 | py | Python | pipenv/progress.py | erikkemperman/pipenv | 8707fe52571422ff5aa2905a2063fdf5ce14840b | [
"MIT"
] | 1 | 2019-12-17T11:54:00.000Z | 2019-12-17T11:54:00.000Z | pipenv/progress.py | erikkemperman/pipenv | 8707fe52571422ff5aa2905a2063fdf5ce14840b | [
"MIT"
] | null | null | null | pipenv/progress.py | erikkemperman/pipenv | 8707fe52571422ff5aa2905a2063fdf5ce14840b | [
"MIT"
] | 1 | 2019-12-03T12:51:31.000Z | 2019-12-03T12:51:31.000Z | # -*- coding: utf-8 -*-
"""
clint.textui.progress
~~~~~~~~~~~~~~~~~
This module provides the progressbar functionality.
"""
from __future__ import absolute_import
import os
import sys
import time
import crayons
from .environments import PIPENV_COLORBLIND, PIPENV_HIDE_EMOJIS
STREAM = sys.stderr
MILL_TEMPLATE = "... | 28.064655 | 81 | 0.528797 |
4c4a74401dddb70f839845269b136af96625ee98 | 983 | py | Python | setup.py | spirousschuh/git-workshop-py-packaging | 8093cfa0143cc27306be56c9f8cf2ff3b6da6c8c | [
"MIT"
] | null | null | null | setup.py | spirousschuh/git-workshop-py-packaging | 8093cfa0143cc27306be56c9f8cf2ff3b6da6c8c | [
"MIT"
] | null | null | null | setup.py | spirousschuh/git-workshop-py-packaging | 8093cfa0143cc27306be56c9f8cf2ff3b6da6c8c | [
"MIT"
] | null | null | null | import io
import os
import re
import setuptools
def read(filename):
filename = os.path.join(os.path.dirname(__file__), filename)
text_type = type(u"")
with io.open(filename, mode="r", encoding='utf-8') as fd:
return re.sub(
text_type(r':[a-z]+:`~?(.*?)`'),
text_type(r'``\1`... | 25.868421 | 68 | 0.62767 |
b413c5bf2b918c8e74f9a3c73cd926a2c1298c9d | 11,489 | py | Python | models_test.py | google/meterstick | 11ab35769922f7a1d922790f1bc7e4d03c11f3a8 | [
"Apache-2.0"
] | 86 | 2016-11-03T17:45:12.000Z | 2022-03-30T00:28:34.000Z | models_test.py | google/meterstick | 11ab35769922f7a1d922790f1bc7e4d03c11f3a8 | [
"Apache-2.0"
] | 3 | 2021-01-20T22:53:24.000Z | 2021-03-19T19:50:27.000Z | models_test.py | google/meterstick | 11ab35769922f7a1d922790f1bc7e4d03c11f3a8 | [
"Apache-2.0"
] | 21 | 2016-11-04T17:03:58.000Z | 2022-02-16T10:28:20.000Z | # Copyright 2020 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 39.4811 | 87 | 0.610497 |
9041ed19568ef0b4af7216757c9c63c1868b32c3 | 1,030 | py | Python | putput/logger.py | cicorias/putput | 96bde3c2219070bfed1ca76d47a4fe7cd0bc4b44 | [
"MIT"
] | 1 | 2019-01-17T07:45:43.000Z | 2019-01-17T07:45:43.000Z | putput/logger.py | cicorias/putput | 96bde3c2219070bfed1ca76d47a4fe7cd0bc4b44 | [
"MIT"
] | 1 | 2019-01-17T07:47:04.000Z | 2019-01-17T07:47:04.000Z | putput/logger.py | cicorias/putput | 96bde3c2219070bfed1ca76d47a4fe7cd0bc4b44 | [
"MIT"
] | null | null | null | import logging
import sys
from typing import IO
def get_logger(module_name: str, *, level: int = logging.INFO, stream: IO[str] = sys.stderr) -> logging.Logger:
"""Returns a configured logger for the module.
Args:
module_name: __name__ for the calling module.
level: Minimum logging level. Mes... | 30.294118 | 111 | 0.673786 |
39dd8f6364101a03ea86c4b3cb8fc5ea2a5319b9 | 8,230 | py | Python | salt/modules/nix.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 5 | 2017-02-07T05:39:29.000Z | 2020-06-13T02:07:33.000Z | salt/modules/nix.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 86 | 2017-01-27T11:54:46.000Z | 2020-05-20T06:25:26.000Z | salt/modules/nix.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 11 | 2017-01-26T19:36:29.000Z | 2021-12-11T07:54:16.000Z | # -*- coding: utf-8 -*-
'''
Work with Nix packages
======================
.. versionadded:: 2017.7.0
Does not require the machine to be Nixos, just have Nix installed and available
to use for the user running this command. Their profile must be located in
their home, under ``$HOME/.nix-profile/``, and the nix store, ... | 28.978873 | 138 | 0.638639 |
ff261b104d60ebff4ecbcd8f213fc8cc54f13887 | 4,667 | py | Python | repos/system_upgrade/el7toel8/actors/spamassassinconfigcheck/libraries/spamassassinconfigcheck.py | sm00th/leapp-repository | 1c171ec3a5f9260a3c6f84a9b15cad78a875ac61 | [
"Apache-2.0"
] | 21 | 2018-11-20T15:58:39.000Z | 2022-03-15T19:57:24.000Z | repos/system_upgrade/el7toel8/actors/spamassassinconfigcheck/libraries/spamassassinconfigcheck.py | sm00th/leapp-repository | 1c171ec3a5f9260a3c6f84a9b15cad78a875ac61 | [
"Apache-2.0"
] | 732 | 2018-11-21T18:33:26.000Z | 2022-03-31T16:16:24.000Z | repos/system_upgrade/el7toel8/actors/spamassassinconfigcheck/libraries/spamassassinconfigcheck.py | sm00th/leapp-repository | 1c171ec3a5f9260a3c6f84a9b15cad78a875ac61 | [
"Apache-2.0"
] | 85 | 2018-11-20T17:55:00.000Z | 2022-03-29T09:40:31.000Z | from leapp import reporting
from leapp.libraries.common.spamassassinutils import \
SPAMC_CONFIG_FILE, SPAMASSASSIN_SERVICE_OVERRIDE, SYSCONFIG_SPAMASSASSIN
def _check_spamc_config(facts, report_func):
title = ('spamc no longer allows specifying the TLS version and no longer '
'supports SSLv3')
... | 44.447619 | 104 | 0.668309 |
fbcadf04c2e561ff2a61e35182400943312b5627 | 72 | py | Python | plugins/sql/komand_sql/actions/__init__.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/sql/komand_sql/actions/__init__.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/sql/komand_sql/actions/__init__.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z | # GENERATED BY KOMAND SDK - DO NOT EDIT
from .query.action import Query
| 24 | 39 | 0.763889 |
39685d9fa09281bf158724f6f908ea9b23987c77 | 2,039 | py | Python | src/main.py | zeqiufan/Distributional-Signatures | fcda2739af36fc99341794a37ab89667fbe2b719 | [
"MIT"
] | 1 | 2020-11-27T07:27:19.000Z | 2020-11-27T07:27:19.000Z | src/main.py | zeqiufan/Distributional-Signatures | fcda2739af36fc99341794a37ab89667fbe2b719 | [
"MIT"
] | null | null | null | src/main.py | zeqiufan/Distributional-Signatures | fcda2739af36fc99341794a37ab89667fbe2b719 | [
"MIT"
] | null | null | null | import os
import pickle
from classifier.classifier_getter import get_classifier
from train.train import train
from train.test import test
from tools.tool import parse_args, print_args, set_seed
from tools.visualization import Print_Attention
import dataset.loader as loader
from embedding.embedding import ... | 27.931507 | 71 | 0.602256 |
fd16ed8e4cb6ea93c13d4bc2ab73f10f313e721e | 13,504 | py | Python | cryptoapis/model/get_block_details_by_block_height_from_callback_r.py | Crypto-APIs/Crypto_APIs_2.0_SDK_Python | c59ebd914850622b2c6500c4c30af31fb9cecf0e | [
"MIT"
] | 5 | 2021-05-17T04:45:03.000Z | 2022-03-23T12:51:46.000Z | cryptoapis/model/get_block_details_by_block_height_from_callback_r.py | Crypto-APIs/Crypto_APIs_2.0_SDK_Python | c59ebd914850622b2c6500c4c30af31fb9cecf0e | [
"MIT"
] | null | null | null | cryptoapis/model/get_block_details_by_block_height_from_callback_r.py | Crypto-APIs/Crypto_APIs_2.0_SDK_Python | c59ebd914850622b2c6500c4c30af31fb9cecf0e | [
"MIT"
] | 2 | 2021-06-02T07:32:26.000Z | 2022-02-12T02:36:23.000Z | """
CryptoAPIs
Crypto APIs 2.0 is a complex and innovative infrastructure layer that radically simplifies the development of any Blockchain and Crypto related applications. Organized around REST, Crypto APIs 2.0 can assist both novice Bitcoin/Ethereum enthusiasts and crypto experts with the development of thei... | 47.382456 | 484 | 0.600933 |
c925090b3309edbb30d49ecf95f87737afb1ef69 | 3,985 | py | Python | plotly/validators/parcoords/_line.py | omridanan/plotly.py | a8d26670cba49ce15ce9b7639ae0f55a6088a825 | [
"MIT"
] | null | null | null | plotly/validators/parcoords/_line.py | omridanan/plotly.py | a8d26670cba49ce15ce9b7639ae0f55a6088a825 | [
"MIT"
] | null | null | null | plotly/validators/parcoords/_line.py | omridanan/plotly.py | a8d26670cba49ce15ce9b7639ae0f55a6088a825 | [
"MIT"
] | 1 | 2019-02-18T04:12:56.000Z | 2019-02-18T04:12:56.000Z | import _plotly_utils.basevalidators
class LineValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name='line', parent_name='parcoords', **kwargs):
super(LineValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
da... | 48.597561 | 78 | 0.557089 |
110cfccf70c6b80537fb3075aa0197d70f37b5d9 | 4,052 | py | Python | source/bin/codebuild_scripts/find_replace.py | pankajagrawal16/aws-control-tower-customizations | e4752bf19a1c8f0a597195982d63a1a2c2dd799a | [
"Apache-2.0"
] | 1 | 2020-02-11T16:34:09.000Z | 2020-02-11T16:34:09.000Z | source/bin/codebuild_scripts/find_replace.py | pankajagrawal16/aws-control-tower-customizations | e4752bf19a1c8f0a597195982d63a1a2c2dd799a | [
"Apache-2.0"
] | null | null | null | source/bin/codebuild_scripts/find_replace.py | pankajagrawal16/aws-control-tower-customizations | e4752bf19a1c8f0a597195982d63a1a2c2dd799a | [
"Apache-2.0"
] | null | null | null | # Copyright 2012-2019 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 "licens... | 37.518519 | 116 | 0.661649 |
595f8c6c82377cf84eadbb72c89dd147ba5ab3ae | 629 | py | Python | hard-gists/651080/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 21 | 2019-07-08T08:26:45.000Z | 2022-01-24T23:53:25.000Z | hard-gists/651080/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 5 | 2019-06-15T14:47:47.000Z | 2022-02-26T05:02:56.000Z | hard-gists/651080/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 17 | 2019-05-16T03:50:34.000Z | 2021-01-14T14:35:12.000Z |
from django import forms
class EmptyChoiceField(forms.ChoiceField):
def __init__(self, choices=(), empty_label=None, required=True, widget=None, label=None,
initial=None, help_text=None, *args, **kwargs):
# prepend an empty label if it exists (and field is not required!)
if not r... | 48.384615 | 110 | 0.648649 |
59039ec9acc414dc290032731831d0494ae97553 | 6,528 | py | Python | docs/developer/release/sanity_checks.py | t-8ch/checker-framework | 3a48b8e1a8933c0faf06a3f1272b0c722e312b81 | [
"MIT"
] | null | null | null | docs/developer/release/sanity_checks.py | t-8ch/checker-framework | 3a48b8e1a8933c0faf06a3f1272b0c722e312b81 | [
"MIT"
] | 3 | 2022-02-28T19:47:56.000Z | 2022-03-30T19:32:52.000Z | docs/developer/release/sanity_checks.py | t-8ch/checker-framework | 3a48b8e1a8933c0faf06a3f1272b0c722e312b81 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# encoding: utf-8
"""
releaseutils.py
This contains no main method only utility functions to
run sanity checks on the Checker Framework.
Created by Jonathan Burke 11/21/2012
Copyright (c) 2012 University of Washington
"""
import zipfile
from release_vars import *
from release_utils import *
... | 42.666667 | 178 | 0.703891 |
cebc148e3a6c9579eb762eca6402486f277c766d | 772 | py | Python | python/1/2/254.py | sxnazirov/informatics.mccme.ru | 5c434ec17af91b241aad3e12fcfe30decc01b134 | [
"BSD-3-Clause"
] | 1 | 2017-11-09T17:17:30.000Z | 2017-11-09T17:17:30.000Z | python/1/2/254.py | sxnazirov/informatics.mccme.ru | 5c434ec17af91b241aad3e12fcfe30decc01b134 | [
"BSD-3-Clause"
] | 1 | 2020-12-03T21:30:44.000Z | 2020-12-03T21:30:44.000Z | python/1/2/254.py | sxnazirov/informatics.mccme.ru | 5c434ec17af91b241aad3e12fcfe30decc01b134 | [
"BSD-3-Clause"
] | 2 | 2019-09-25T16:44:50.000Z | 2021-01-17T22:00:01.000Z | # Задача №254. Ладья
#
# Требуется определить, бьет ли ладья, стоящая на клетке с указанными координатами (номер строки и номер столбца),
# фигуру, стоящую на другой указанной клетке.
#
# Входные данные
# Вводятся четыре числа: координаты ладьи (два числа) и координаты другой фигуры (два числа),
# каждое число вводится... | 19.794872 | 114 | 0.69171 |
1c3b09d840e3ffbc3af67b126048f4eaf366fa05 | 11,294 | py | Python | cogdl/pipelines.py | zhangdan0602/cogdl | 35a338f29066e4b1a5d7f46217f09ebceaf13106 | [
"MIT"
] | null | null | null | cogdl/pipelines.py | zhangdan0602/cogdl | 35a338f29066e4b1a5d7f46217f09ebceaf13106 | [
"MIT"
] | null | null | null | cogdl/pipelines.py | zhangdan0602/cogdl | 35a338f29066e4b1a5d7f46217f09ebceaf13106 | [
"MIT"
] | null | null | null | import os
import random
import matplotlib.cm as cm
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
from numpy.lib.arraysetops import isin
import torch
import yaml
from grave import plot_network, use_attributes
from tabulate import tabulate
from cogdl import oagbert
from cogdl.data import Grap... | 36.668831 | 118 | 0.600673 |
dd42f1dd389733018c8cfcda304d92d0edb1f775 | 495 | py | Python | env/Lib/site-packages/OpenGL/raw/GL/ARB/shader_clock.py | 5gconnectedbike/Navio2 | 8c3f2b5d8bbbcea1fc08739945183c12b206712c | [
"BSD-3-Clause"
] | 210 | 2016-04-09T14:26:00.000Z | 2022-03-25T18:36:19.000Z | env/Lib/site-packages/OpenGL/raw/GL/ARB/shader_clock.py | 5gconnectedbike/Navio2 | 8c3f2b5d8bbbcea1fc08739945183c12b206712c | [
"BSD-3-Clause"
] | 72 | 2016-09-04T09:30:19.000Z | 2022-03-27T17:06:53.000Z | env/Lib/site-packages/OpenGL/raw/GL/ARB/shader_clock.py | 5gconnectedbike/Navio2 | 8c3f2b5d8bbbcea1fc08739945183c12b206712c | [
"BSD-3-Clause"
] | 64 | 2016-04-09T14:26:49.000Z | 2022-03-21T11:19:47.000Z | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_... | 30.9375 | 113 | 0.789899 |
6bbcbe12a3cfe5899558947c190da362d51d22e5 | 3,129 | py | Python | data/p2DJ/New/program/qiskit/QC/startQiskit_QC190.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p2DJ/New/program/qiskit/QC/startQiskit_QC190.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p2DJ/New/program/qiskit/QC/startQiskit_QC190.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=2
# total number=9
import cirq
import qiskit
from qiskit import IBMQ
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy as... | 28.189189 | 82 | 0.624481 |
96060aa11a081eb32cfdb38bf5ba114dc58c4faa | 7,227 | py | Python | src/test/tinc/tincrepo/mpp/lib/test/test_psql.py | rodel-talampas/gpdb | 9c955e350334abbd922102f289f782697eb52069 | [
"PostgreSQL",
"Apache-2.0"
] | 9 | 2018-04-20T03:31:01.000Z | 2020-05-13T14:10:53.000Z | src/test/tinc/tincrepo/mpp/lib/test/test_psql.py | rodel-talampas/gpdb | 9c955e350334abbd922102f289f782697eb52069 | [
"PostgreSQL",
"Apache-2.0"
] | 36 | 2017-09-21T09:12:27.000Z | 2020-06-17T16:40:48.000Z | src/test/tinc/tincrepo/mpp/lib/test/test_psql.py | rodel-talampas/gpdb | 9c955e350334abbd922102f289f782697eb52069 | [
"PostgreSQL",
"Apache-2.0"
] | 32 | 2017-08-31T12:50:52.000Z | 2022-03-01T07:34:53.000Z | """
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the 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.... | 48.831081 | 99 | 0.661962 |
0b48128c90a27f10b54d6f60493a533921dcbe0d | 486 | py | Python | release/stubs.min/System/Runtime/InteropServices/__init___parts/RuntimeInformation.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/System/Runtime/InteropServices/__init___parts/RuntimeInformation.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/System/Runtime/InteropServices/__init___parts/RuntimeInformation.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | class RuntimeInformation(object):
# no doc
def ZZZ(self):
"""hardcoded/mock instance of the class"""
return RuntimeInformation()
instance=ZZZ()
"""hardcoded/returns an instance of the class"""
@staticmethod
def IsOSPlatform(osPlatform):
""" IsOSPlatform(osPlatform: OSPlatform) -> bool """
pass
FrameworkD... | 24.3 | 54 | 0.738683 |
652543723f641a409c2efea48ee38f83fb6c9373 | 1,174 | py | Python | bitcom/utils/url_params_builder.py | bitcom-exchange/bitcom-python-api | 1491481f376ba7e7d4a7d2edb2f4400b8e4d7ec3 | [
"MIT"
] | 4 | 2021-03-04T00:10:24.000Z | 2021-12-15T01:49:39.000Z | bitcom/utils/url_params_builder.py | bitcom-exchange/bitcom-python-api | 1491481f376ba7e7d4a7d2edb2f4400b8e4d7ec3 | [
"MIT"
] | null | null | null | bitcom/utils/url_params_builder.py | bitcom-exchange/bitcom-python-api | 1491481f376ba7e7d4a7d2edb2f4400b8e4d7ec3 | [
"MIT"
] | null | null | null | import json
import urllib.parse
class UrlParamsBuilder(object):
def __init__(self):
self.param_map = dict()
self.post_map = dict()
self.post_list = list()
def put_url(self, name, value):
if value is not None:
if isinstance(value, (list, dict)):
sel... | 28.634146 | 62 | 0.531516 |
3f1c7db3e52c873322c1c1e1d00171df3568f307 | 1,774 | py | Python | src/vpoller/task/core.py | nikypint/py-vpoller | c7657dfc73831adf03c88363dee51c545ff8d511 | [
"BSD-2-Clause"
] | 58 | 2015-01-22T11:22:44.000Z | 2021-12-18T00:32:53.000Z | src/vpoller/task/core.py | nikypint/py-vpoller | c7657dfc73831adf03c88363dee51c545ff8d511 | [
"BSD-2-Clause"
] | 176 | 2015-01-05T15:53:10.000Z | 2022-03-30T17:50:18.000Z | src/vpoller/task/core.py | nikypint/py-vpoller | c7657dfc73831adf03c88363dee51c545ff8d511 | [
"BSD-2-Clause"
] | 46 | 2015-01-22T11:22:48.000Z | 2022-02-22T09:09:57.000Z | # Copyright (c) 2013-2015 Marin Atanasov Nikolov <dnaeon@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notic... | 37.744681 | 75 | 0.742954 |
bd456e6f4efbc881c93302abfe53aa9ddcc10462 | 148,869 | py | Python | src/antlr4_verilog/systemverilog/SystemVerilogParserVisitor.py | mtdsousa/antlr4-verilog | c2238beb56a38ac098cd6e06e0ac8d7de7c1eaad | [
"MIT"
] | 3 | 2022-02-15T15:51:43.000Z | 2022-02-21T13:18:09.000Z | src/antlr4_verilog/systemverilog/SystemVerilogParserVisitor.py | mtdsousa/antlr4-verilog | c2238beb56a38ac098cd6e06e0ac8d7de7c1eaad | [
"MIT"
] | 1 | 2022-02-21T12:35:10.000Z | 2022-02-21T16:45:56.000Z | src/antlr4_verilog/systemverilog/SystemVerilogParserVisitor.py | mtdsousa/antlr4-verilog-python | c2238beb56a38ac098cd6e06e0ac8d7de7c1eaad | [
"MIT"
] | null | null | null | # Generated from /home/mtdsousa/workspace/antlr4-verilog-python/extra/grammars-v4-2/verilog/systemverilog/SystemVerilogParser.g4 by ANTLR 4.9
from antlr4 import *
if __name__ is not None and "." in __name__:
from .SystemVerilogParser import SystemVerilogParser
else:
from SystemVerilogParser import SystemVerilog... | 42.256316 | 141 | 0.796647 |
09b6fdb93690cb1587edb277d542bd64fa322c53 | 11,510 | py | Python | theano/tensor/nnet/__init__.py | bridgeland/Theano-PyMC | ddfbde2d03061dead7190a99b78c7cef7896bd04 | [
"BSD-3-Clause"
] | null | null | null | theano/tensor/nnet/__init__.py | bridgeland/Theano-PyMC | ddfbde2d03061dead7190a99b78c7cef7896bd04 | [
"BSD-3-Clause"
] | null | null | null | theano/tensor/nnet/__init__.py | bridgeland/Theano-PyMC | ddfbde2d03061dead7190a99b78c7cef7896bd04 | [
"BSD-3-Clause"
] | null | null | null | from .nnet import (
CrossentropyCategorical1Hot,
CrossentropyCategorical1HotGrad,
CrossentropySoftmax1HotWithBiasDx,
CrossentropySoftmaxArgmax1HotWithBias,
LogSoftmax,
Prepend_scalar_constant_to_each_row,
Prepend_scalar_to_each_row,
Softmax,
SoftmaxGrad,
SoftmaxWithBias,
bina... | 35.091463 | 81 | 0.668723 |
2818cd22e11522ee1c6903cc5fb1bc5c68d23bb5 | 6,212 | py | Python | rectorch/configuration.py | amitsultan/rectorch | 04c8fc20bb09d30402c1cdb5091b11567f940bdf | [
"MIT"
] | 148 | 2020-04-26T10:07:17.000Z | 2022-03-14T21:53:09.000Z | rectorch/configuration.py | amitsultan/rectorch | 04c8fc20bb09d30402c1cdb5091b11567f940bdf | [
"MIT"
] | 2 | 2020-06-20T09:13:10.000Z | 2020-09-13T10:36:59.000Z | rectorch/configuration.py | amitsultan/rectorch | 04c8fc20bb09d30402c1cdb5091b11567f940bdf | [
"MIT"
] | 21 | 2020-05-23T14:04:04.000Z | 2021-12-28T06:53:48.000Z | r"""The module contains useful classes to manage the configuration files.
Configuration files are useful to correctly initialize the data processing and the
recommendation engines. Configuration files must be `.json <https://www.json.org/json-en.html>`_
files with a specific format. Details about the file formats are ... | 35.907514 | 100 | 0.652447 |
2ce372f8626f38c9ccdb332f4ba6d0494c32b5a2 | 1,592 | py | Python | docs/source/examples/boundschecking.py | convexengineering/gpk | c8cf2b30ce1c3d28f135352bd584a0130e903e3f | [
"MIT"
] | 76 | 2017-10-24T18:38:48.000Z | 2022-01-13T03:14:37.000Z | docs/source/examples/boundschecking.py | convexengineering/gpk | c8cf2b30ce1c3d28f135352bd584a0130e903e3f | [
"MIT"
] | 485 | 2017-09-22T18:31:06.000Z | 2022-03-02T20:34:11.000Z | docs/source/examples/boundschecking.py | appliedopt/gpkit | 647ef0a2a0ff625026943bfd7fb5ca560100898b | [
"MIT"
] | 23 | 2017-12-11T01:29:00.000Z | 2022-02-14T07:53:16.000Z | "Verifies that bounds are caught through monomials"
from gpkit import Model, parse_variables
from gpkit.exceptions import UnboundedGP, UnknownInfeasible
class BoundsChecking(Model):
"""Implements a crazy set of unbounded variables.
Variables
---------
Ap [-] d
D [-] e
F ... | 24.121212 | 75 | 0.481784 |
845bb751f093fb0e2da874df31c34e66386ed945 | 26,453 | py | Python | lib/blockchain.py | BTHPOS/electrum | 8a8e8ce7f154ca000d9d9d462e47a383d5bde281 | [
"MIT"
] | null | null | null | lib/blockchain.py | BTHPOS/electrum | 8a8e8ce7f154ca000d9d9d462e47a383d5bde281 | [
"MIT"
] | 4 | 2019-01-09T15:11:30.000Z | 2021-11-15T17:48:05.000Z | lib/blockchain.py | BTHPOS/electrum | 8a8e8ce7f154ca000d9d9d462e47a383d5bde281 | [
"MIT"
] | 1 | 2019-10-02T19:06:46.000Z | 2019-10-02T19:06:46.000Z | # Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@ecdsa.org
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights... | 35.79567 | 149 | 0.601671 |
d7711bd42bd03c23e8214a69e77e75c873335471 | 10,771 | py | Python | DCT.py | MaFx/dct-algorithm | 16f3177967aec66c61d209b52a018112ca5edbcc | [
"MIT"
] | null | null | null | DCT.py | MaFx/dct-algorithm | 16f3177967aec66c61d209b52a018112ca5edbcc | [
"MIT"
] | null | null | null | DCT.py | MaFx/dct-algorithm | 16f3177967aec66c61d209b52a018112ca5edbcc | [
"MIT"
] | null | null | null | from numpy import fft,array,arange,zeros,dot,transpose
from math import sqrt,cos,pi
from numpy import fft,array,arange,zeros,dot,transpose
from math import sqrt,cos,pi
import time
import os
import numpy
import wx
from PIL import Image
from threading import *
qmatrix = numpy.array([[ 16 , 11 , 10 , 16 , 24 , 40 , 51 ... | 34.633441 | 137 | 0.485006 |
4434496b1a6d57f80b50f6fba749ecc605fb3e2b | 8,967 | py | Python | cirq/linalg/diagonalize_test.py | kunalq/Cirq | e73c9bef672e83143ab04e7f169988149055d630 | [
"Apache-2.0"
] | 2 | 2019-04-02T09:16:28.000Z | 2019-05-25T18:35:19.000Z | cirq/linalg/diagonalize_test.py | rajeshkumarkarra/Cirq | 5ad06cc7a487ca94436715a3c51b6a50dfd10513 | [
"Apache-2.0"
] | 36 | 2019-04-03T23:03:51.000Z | 2019-05-15T23:49:01.000Z | cirq/linalg/diagonalize_test.py | rajeshkumarkarra/Cirq | 5ad06cc7a487ca94436715a3c51b6a50dfd10513 | [
"Apache-2.0"
] | 2 | 2019-04-03T22:55:05.000Z | 2019-04-24T23:24:53.000Z | # Copyright 2018 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 ... | 31.135417 | 79 | 0.558492 |
6639beb1f14a0c9d716e3ccd6bd569b85a16b64d | 1,527 | py | Python | python/cudf/cudf/tests/test_copying.py | ofaz/cudf | 9fff633eabb75301437439e374d2419f0ca41ec0 | [
"Apache-2.0"
] | null | null | null | python/cudf/cudf/tests/test_copying.py | ofaz/cudf | 9fff633eabb75301437439e374d2419f0ca41ec0 | [
"Apache-2.0"
] | null | null | null | python/cudf/cudf/tests/test_copying.py | ofaz/cudf | 9fff633eabb75301437439e374d2419f0ca41ec0 | [
"Apache-2.0"
] | null | null | null | from __future__ import division, print_function
import numpy as np
from librmm_cffi import librmm as rmm
import cudf._lib as libcudf
from cudf.core.column import column
def test_gather_single_col():
col = column.as_column(np.arange(100), dtype=np.int32)
gather_map = np.array([0, 1, 2, 3, 5, 8, 13, 21], dty... | 31.163265 | 69 | 0.679109 |
2db16733c870af7bb88c9abc41c6d9e57da5d75f | 2,032 | py | Python | Machine-Learning-master/SVM/svm-svc.py | lcscim/python-demo | c312b53f9a0f845051e6b9966d030753505d6c56 | [
"Apache-2.0"
] | null | null | null | Machine-Learning-master/SVM/svm-svc.py | lcscim/python-demo | c312b53f9a0f845051e6b9966d030753505d6c56 | [
"Apache-2.0"
] | null | null | null | Machine-Learning-master/SVM/svm-svc.py | lcscim/python-demo | c312b53f9a0f845051e6b9966d030753505d6c56 | [
"Apache-2.0"
] | null | null | null | # -*- coding: UTF-8 -*-
import numpy as np
import operator
from os import listdir
from sklearn.svm import SVC
"""
Author:
Jack Cui
Blog:
http://blog.csdn.net/c406495762
Zhihu:
https://www.zhihu.com/people/Jack--Cui/
Modify:
2017-10-04
"""
def img2vector(filename):
"""
将32x32的二进制图像转换为1x1024向量。
Parameters:... | 22.32967 | 75 | 0.71998 |
1bd63ccf6a23537594b5fed1b67309913a862fae | 20,455 | py | Python | Lib/site.py | yxfcodeup/ReadPython3.6 | 636ada2620823f88d92746242019b9611615a477 | [
"PSF-2.0"
] | null | null | null | Lib/site.py | yxfcodeup/ReadPython3.6 | 636ada2620823f88d92746242019b9611615a477 | [
"PSF-2.0"
] | null | null | null | Lib/site.py | yxfcodeup/ReadPython3.6 | 636ada2620823f88d92746242019b9611615a477 | [
"PSF-2.0"
] | null | null | null | """Append module search paths for third-party packages to sys.path.
****************************************************************
* This module is automatically imported during initialization. *
****************************************************************
This will append site-specific paths to the module sear... | 34.148581 | 84 | 0.630066 |
2530b6e808a9a5b1121e08fa9aed7872939ba575 | 2,592 | py | Python | pyshadowsocks/tests/protocol/shadowsocks/test_header.py | FTwOoO/pyShadowsocks | 452323e30c4b97d322cbb67e9bbc7c4549e67b5f | [
"MIT"
] | 21 | 2016-08-01T06:48:01.000Z | 2021-04-05T18:20:53.000Z | pyshadowsocks/tests/protocol/shadowsocks/test_header.py | zen-of-proxy/pyShadowsocks | 452323e30c4b97d322cbb67e9bbc7c4549e67b5f | [
"MIT"
] | 2 | 2016-07-23T02:33:17.000Z | 2018-03-13T09:50:02.000Z | pyshadowsocks/tests/protocol/shadowsocks/test_header.py | FTwOoO/pyShadowsocks | 452323e30c4b97d322cbb67e9bbc7c4549e67b5f | [
"MIT"
] | 7 | 2017-04-22T16:53:53.000Z | 2021-02-08T06:33:05.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: booopooob@gmail.com
#
# Info:
#
#
import socket
import unittest
import constants
from protocol.shadowsocks.header import ShadowsocksPacketHeader
class HeaderTest(unittest.TestCase):
def test_fields(self):
header = ShadowsocksPacketHeader()
... | 38.117647 | 115 | 0.680941 |
2bf618ff77e88b0ca422ea7a3f49eebc627edd7f | 7,253 | py | Python | docs/conf.py | alkasm/pyuavcan | 077c4165e3b12677d7294c9838462dba4d28dff8 | [
"MIT"
] | 1 | 2022-01-02T03:15:17.000Z | 2022-01-02T03:15:17.000Z | docs/conf.py | alkasm/pyuavcan | 077c4165e3b12677d7294c9838462dba4d28dff8 | [
"MIT"
] | null | null | null | docs/conf.py | alkasm/pyuavcan | 077c4165e3b12677d7294c9838462dba4d28dff8 | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or module... | 30.86383 | 119 | 0.678202 |
24b957974fec2a92b9b97042270c3751e64bf88c | 5,030 | py | Python | python/mlad/cli/autocompletion.py | onetop21/MLAppDeploy | 42e5fa6b58b0fb90043feb85af7ae8da9159bfc8 | [
"MIT"
] | null | null | null | python/mlad/cli/autocompletion.py | onetop21/MLAppDeploy | 42e5fa6b58b0fb90043feb85af7ae8da9159bfc8 | [
"MIT"
] | 209 | 2020-09-14T11:54:35.000Z | 2022-03-30T09:26:33.000Z | python/mlad/cli/autocompletion.py | onetop21/MLAppDeploy | 42e5fa6b58b0fb90043feb85af7ae8da9159bfc8 | [
"MIT"
] | null | null | null | import sys
import os
import glob
from omegaconf import OmegaConf
from mlad.core.default import project as default_project
from mlad.core.default.config import service_config
from mlad.core.docker import controller as ctlr
from mlad.cli.libs import utils
from mlad.cli import config as config_core
from mlad.api import AP... | 38.396947 | 104 | 0.644334 |
dabdf49f9c2e6e019183f916fdfe732f9f20bc9a | 5,196 | py | Python | tests/catalyst/contrib/datasets/test_movielens_20m.py | futurewarning/catalyst | 678dc06eda1848242df010b7f34adb572def2598 | [
"Apache-2.0"
] | 2,693 | 2019-01-23T19:16:12.000Z | 2022-03-31T02:12:42.000Z | tests/catalyst/contrib/datasets/test_movielens_20m.py | futurewarning/catalyst | 678dc06eda1848242df010b7f34adb572def2598 | [
"Apache-2.0"
] | 763 | 2019-01-22T20:12:56.000Z | 2022-03-27T18:36:10.000Z | tests/catalyst/contrib/datasets/test_movielens_20m.py | futurewarning/catalyst | 678dc06eda1848242df010b7f34adb572def2598 | [
"Apache-2.0"
] | 445 | 2019-01-23T17:07:09.000Z | 2022-03-30T05:38:45.000Z | import os
import shutil
import pytest
from catalyst.settings import SETTINGS
if SETTINGS.ml_required and SETTINGS.is_torch_1_7_0:
from catalyst.contrib.datasets import MovieLens20M
minversion = pytest.mark.skipif(
not (SETTINGS.is_torch_1_7_0), reason="No catalyst[ml] required or torch version "
)
def set... | 30.385965 | 99 | 0.674365 |
d342919eee5cbe00892213cd304f5203a377f43b | 8,957 | py | Python | selfdrive/test/test_onroad.py | nasser-glx/openpilot_2023 | 6bf52be2df60ce46d213d4b3ff3c94428e962733 | [
"MIT"
] | 1 | 2021-12-06T02:26:45.000Z | 2021-12-06T02:26:45.000Z | selfdrive/test/test_onroad.py | nasser-glx/openpilot_2023 | 6bf52be2df60ce46d213d4b3ff3c94428e962733 | [
"MIT"
] | null | null | null | selfdrive/test/test_onroad.py | nasser-glx/openpilot_2023 | 6bf52be2df60ce46d213d4b3ff3c94428e962733 | [
"MIT"
] | 5 | 2019-07-14T08:40:59.000Z | 2019-08-10T01:47:33.000Z | #!/usr/bin/env python3
import json
import os
import subprocess
import time
import numpy as np
import unittest
from collections import Counter
from pathlib import Path
from cereal import car
import cereal.messaging as messaging
from cereal.services import service_list
from common.basedir import BASEDIR
from common.time... | 33.8 | 123 | 0.594284 |
de4b975ae971ec4ebdd31828769b71d372456100 | 9,953 | py | Python | pvl/grammar.py | AndrewAnnex/pvl | be90a3e5425875828ca70e8fc66c67992559c64c | [
"BSD-3-Clause"
] | null | null | null | pvl/grammar.py | AndrewAnnex/pvl | be90a3e5425875828ca70e8fc66c67992559c64c | [
"BSD-3-Clause"
] | null | null | null | pvl/grammar.py | AndrewAnnex/pvl | be90a3e5425875828ca70e8fc66c67992559c64c | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Describes the language aspects of PVL dialects."""
# Copyright 2019-2020, ``pvl`` library authors.
#
# Reuse is permitted under the terms of the license.
# The AUTHORS file and the LICENSE file are at the
# top level of this library.
import re
class PVLGrammar():
"""Describes a PVL gr... | 40.45935 | 82 | 0.625138 |
4f7376bfb9f682f93564846c0ada4f90f92b9bb3 | 51,101 | py | Python | python/ccxt/async_support/hollaex.py | k0ne/ccxt | 1d29ae43671f79d1a70f9f2e59145765e00c8d62 | [
"MIT"
] | 1 | 2022-01-26T04:35:56.000Z | 2022-01-26T04:35:56.000Z | python/ccxt/async_support/hollaex.py | k0ne/ccxt | 1d29ae43671f79d1a70f9f2e59145765e00c8d62 | [
"MIT"
] | null | null | null | python/ccxt/async_support/hollaex.py | k0ne/ccxt | 1d29ae43671f79d1a70f9f2e59145765e00c8d62 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import Argumen... | 38.335334 | 185 | 0.434375 |
65c89e73dc5da8aeeb835b9f00270687036eb29f | 593 | py | Python | cloud/ventas/views/pedidos.py | vallemrv/tpvB3 | 9988a528b32692b01bd042cc6486188c4dc2109b | [
"Apache-2.0"
] | 3 | 2017-07-16T09:31:56.000Z | 2019-03-20T11:11:24.000Z | cloud/ventas/views/pedidos.py | ljimaz33/tpvB3 | 9988a528b32692b01bd042cc6486188c4dc2109b | [
"Apache-2.0"
] | null | null | null | cloud/ventas/views/pedidos.py | ljimaz33/tpvB3 | 9988a528b32692b01bd042cc6486188c4dc2109b | [
"Apache-2.0"
] | 1 | 2022-01-02T11:22:45.000Z | 2022-01-02T11:22:45.000Z | # @Author: Manuel Rodriguez <valle>
# @Date: 09-Mar-2018
# @Email: valle.mrv@gmail.com
# @Last modified by: valle
# @Last modified time: 09-Mar-2018
# @License: Apache license vesion 2.0
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from ventas.models import Pedido... | 31.210526 | 78 | 0.731872 |
7654f3b8be76b57d752f9ed8977e2decc9363dd8 | 245 | py | Python | EstruturaSequencial/Exercicio7.py | claudiopmaia/DataScience | 0cae311edc178121d80a15110e16334e31f7c4f4 | [
"MIT"
] | 2 | 2019-01-02T15:56:28.000Z | 2019-01-02T18:54:03.000Z | EstruturaSequencial/Exercicio7.py | claudiopmaia/DataScience | 0cae311edc178121d80a15110e16334e31f7c4f4 | [
"MIT"
] | null | null | null | EstruturaSequencial/Exercicio7.py | claudiopmaia/DataScience | 0cae311edc178121d80a15110e16334e31f7c4f4 | [
"MIT"
] | null | null | null | # Faça um Programa que calcule a área de um quadrado, em seguida mostre o dobro desta área para o usuário.
lado = a = int(input("Digite o lado do quadrado:"))
area = lado * lado
dobroArea = area * area
print(" O dobro da area é :", dobroArea, ) | 40.833333 | 106 | 0.706122 |
270c22081f43a9bf3e34d96b3da922dc3e901815 | 99 | py | Python | counterparty-gui.py | CounterpartyXCP/counterparty-gui | e38d726e80db33774ad17a261881f7a4231f5114 | [
"MIT"
] | 5 | 2015-03-01T14:19:03.000Z | 2016-05-04T05:21:20.000Z | counterparty-gui.py | CounterpartyXCP/counterparty-gui | e38d726e80db33774ad17a261881f7a4231f5114 | [
"MIT"
] | 41 | 2015-01-07T15:02:33.000Z | 2015-04-02T17:01:55.000Z | counterparty-gui.py | CounterpartyXCP/counterparty-gui | e38d726e80db33774ad17a261881f7a4231f5114 | [
"MIT"
] | 16 | 2015-01-07T14:51:32.000Z | 2022-01-13T22:27:50.000Z | #! /usr/bin/env python3
from counterpartygui.gui import main
if __name__ == '__main__':
main() | 19.8 | 36 | 0.707071 |
cb31767f2928ade670dc921a878eeb38dddca874 | 957 | py | Python | old_Learning_Sets/Learning_Set_2:The_Basics/2_functions_main.py | brendo61-byte/pythonOnBoarding | f16fdb1107631591db157b7db8bb1ea8e0dc2e1b | [
"MIT"
] | 1 | 2019-11-10T00:13:18.000Z | 2019-11-10T00:13:18.000Z | old_Learning_Sets/Learning_Set_2:The_Basics/2_functions_main.py | brendo61-byte/pythonOnBoarding | f16fdb1107631591db157b7db8bb1ea8e0dc2e1b | [
"MIT"
] | null | null | null | old_Learning_Sets/Learning_Set_2:The_Basics/2_functions_main.py | brendo61-byte/pythonOnBoarding | f16fdb1107631591db157b7db8bb1ea8e0dc2e1b | [
"MIT"
] | null | null | null | """
Okay this doesn't count as a module but it needs to be done.
So far we have used python like Matlab or assembly - the program is read from top to bottom. That's not how we really do
it.
line 21 "if__name__== '__main__'" is python magic for "HEY! START RUNNING CODE FROM HERE!"
This allows us to create a main func... | 25.864865 | 120 | 0.711599 |
1af1b4c6fb10e636689db89fbcb1c564ed8ebfdb | 2,612 | py | Python | server.py | withrvr/Battle-Snake | 9d81331de7e05bad0ef54e4a2c6a40b672f2a4f1 | [
"MIT"
] | 2 | 2021-02-06T04:45:09.000Z | 2021-02-12T15:50:07.000Z | server.py | withrvr/Battle-Snake | 9d81331de7e05bad0ef54e4a2c6a40b672f2a4f1 | [
"MIT"
] | null | null | null | server.py | withrvr/Battle-Snake | 9d81331de7e05bad0ef54e4a2c6a40b672f2a4f1 | [
"MIT"
] | null | null | null | import os
import random
import cherrypy
class Battlesnake(object):
def __init__(self):
# board height and width
self.board_height = 0
self.board_width = 0
@cherrypy.expose
@cherrypy.tools.json_out()
def index(self):
return {
"apiversion": ... | 23.115044 | 74 | 0.534074 |
18aeefad1096d31673216837298066816867a0ad | 48,627 | py | Python | src/twisted/web/_http2.py | ndg63276/twisted | f672a20395e8beece6350631a70514f06c391bae | [
"Unlicense",
"MIT"
] | 2 | 2021-05-30T16:35:00.000Z | 2021-06-03T12:23:33.000Z | src/twisted/web/_http2.py | ndg63276/twisted | f672a20395e8beece6350631a70514f06c391bae | [
"Unlicense",
"MIT"
] | 20 | 2021-05-03T18:02:23.000Z | 2022-03-12T12:01:04.000Z | src/twisted/web/_http2.py | ndg63276/twisted | f672a20395e8beece6350631a70514f06c391bae | [
"Unlicense",
"MIT"
] | 2 | 2021-05-29T21:12:22.000Z | 2021-05-30T04:56:50.000Z | # -*- test-case-name: twisted.web.test.test_http2 -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
HTTP2 Implementation
This is the basic server-side protocol implementation used by the Twisted
Web server for HTTP2. This functionality is intended to be combined with the
HTTP/1.1 and HT... | 37.812597 | 95 | 0.643367 |
07e0c3323fc698fa4c0b7dedc4fb26296c948ac7 | 2,456 | py | Python | Build/Tools/Scripts/VsMake.py | medazzo/cmop | 660c6da3be6c076e6c272717f396455fbfc37799 | [
"BSD-3-Clause"
] | 4 | 2016-04-26T03:43:54.000Z | 2016-11-17T08:09:04.000Z | Build/Tools/Scripts/VsMake.py | medazzo/cmop | 660c6da3be6c076e6c272717f396455fbfc37799 | [
"BSD-3-Clause"
] | 17 | 2015-01-05T21:06:22.000Z | 2015-12-07T20:45:44.000Z | Build/Tools/Scripts/VsMake.py | medazzo/cmop | 660c6da3be6c076e6c272717f396455fbfc37799 | [
"BSD-3-Clause"
] | 3 | 2016-04-26T03:43:55.000Z | 2020-11-06T11:02:08.000Z | #! /usr/bin/env python
"""
Visual Studio 2005 Build Script
$Id: VsMake.py 655 2010-09-29 22:40:22Z soothe $
"""
import os
import sys
import getopt
import subprocess
# Setup some path stuff
try:
if environ['VISUALSTUDIO_BIN']:
VSBINDIR = environ['VISUALSTUDIO_BIN']
except NameError:
# Use default va... | 25.061224 | 89 | 0.542752 |
27a44d2098f73c2624b38b576b59182ce74f639c | 8,410 | py | Python | gui/my_tkinter/overlay/frame_data_widgets/frame_advantage_panel.py | AndreTeixeira1998/TekkenBot | 015c601afbea5d75a46b3385f1d322b2655249b0 | [
"MIT"
] | 45 | 2019-06-14T00:29:35.000Z | 2022-01-13T15:52:35.000Z | gui/my_tkinter/overlay/frame_data_widgets/frame_advantage_panel.py | AndreTeixeira1998/TekkenBot | 015c601afbea5d75a46b3385f1d322b2655249b0 | [
"MIT"
] | 16 | 2019-07-19T09:06:15.000Z | 2021-04-08T11:29:58.000Z | gui/my_tkinter/overlay/frame_data_widgets/frame_advantage_panel.py | AndreTeixeira1998/TekkenBot | 015c601afbea5d75a46b3385f1d322b2655249b0 | [
"MIT"
] | 10 | 2019-06-14T23:30:26.000Z | 2021-08-23T17:13:03.000Z | #!/usr/bin/env python3
# Copyright (c) 2019, Alchemy Meister
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# ... | 36.724891 | 79 | 0.667182 |
7a186f4943fbc47a3c60c9d6b6fb39bff45590d7 | 12,572 | py | Python | payment_lib_examples/weixin-python/virtual_environement/lib/python3.4/site-packages/weixin/mp.py | cuhk-mobitec/S3KVetter | 9ae79a242afbe6edae27c17065a88feca2896cf6 | [
"Apache-2.0"
] | 7 | 2018-01-29T02:46:31.000Z | 2018-03-25T11:15:10.000Z | payment_lib_examples/weixin-python/virtual_environement/lib/python3.4/site-packages/weixin/mp.py | cuhk-mobitec/S3KVetter | 9ae79a242afbe6edae27c17065a88feca2896cf6 | [
"Apache-2.0"
] | 4 | 2021-06-08T19:38:03.000Z | 2022-03-11T23:18:46.000Z | payment_lib_examples/weixin-python/virtual_environement/lib/python3.4/site-packages/weixin/mp.py | cuhk-mobitec/S3KVetter | 9ae79a242afbe6edae27c17065a88feca2896cf6 | [
"Apache-2.0"
] | 1 | 2021-06-12T14:14:35.000Z | 2021-06-12T14:14:35.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import time
import json
import hashlib
import string
import random
import requests
from .base import Map, WeixinError
__all__ = ("WeixinMPError", "WeixinMP")
DEFAULT_DIR = os.getenv("HOME", os.getcwd())
class WeixinMPError(WeixinError):... | 29.72104 | 107 | 0.582008 |
9d0d3d9c9b61930c6b677909071d73061e796535 | 73,157 | py | Python | Lib/test/support/__init__.py | TobiasRzepka/cpython | 1578de2fcd685c71f9c84e09bac32901dea192c1 | [
"0BSD"
] | null | null | null | Lib/test/support/__init__.py | TobiasRzepka/cpython | 1578de2fcd685c71f9c84e09bac32901dea192c1 | [
"0BSD"
] | null | null | null | Lib/test/support/__init__.py | TobiasRzepka/cpython | 1578de2fcd685c71f9c84e09bac32901dea192c1 | [
"0BSD"
] | null | null | null | """Supporting definitions for the Python regression tests."""
if __name__ != 'test.support':
raise ImportError('support must be imported from the test package')
import contextlib
import functools
import getpass
import os
import re
import stat
import sys
import sysconfig
import time
import types
import unittest
im... | 33.744004 | 92 | 0.624151 |
03d4ca2ceaa0c9300aa737f2829715a61e8be0a4 | 426 | py | Python | plotly/validators/carpet/_a.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/validators/carpet/_a.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 27 | 2020-04-28T21:23:12.000Z | 2021-06-25T15:36:38.000Z | plotly/validators/carpet/_a.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | import _plotly_utils.basevalidators
class AValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(self, plotly_name='a', parent_name='carpet', **kwargs):
super(AValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=kwa... | 30.428571 | 72 | 0.638498 |
205766d4bdb5f179307e23caef8d36addd5fce30 | 12,527 | py | Python | hal/train.py | egonrian/google-research | 8177adbe9ca0d7e5a9463b54581fe6dd27be0974 | [
"Apache-2.0"
] | 3 | 2021-01-18T04:46:49.000Z | 2021-03-05T09:21:40.000Z | hal/train.py | Alfaxad/google-research | 2c0043ecd507e75e2df9973a3015daf9253e1467 | [
"Apache-2.0"
] | 7 | 2021-11-10T19:44:38.000Z | 2022-02-10T06:48:39.000Z | hal/train.py | Alfaxad/google-research | 2c0043ecd507e75e2df9973a3015daf9253e1467 | [
"Apache-2.0"
] | 4 | 2021-02-08T10:25:45.000Z | 2021-04-17T14:46:26.000Z | # coding=utf-8
# Copyright 2020 The Google Research 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 applicab... | 43.04811 | 80 | 0.709507 |
9e36e93826f9cf3135380e9cfd974b1d56cd83ad | 11,818 | py | Python | EDX_quant_main.py | tkcroat/EDX | f447dfbc0b7cde248b70b43772eb177185232960 | [
"MIT"
] | null | null | null | EDX_quant_main.py | tkcroat/EDX | f447dfbc0b7cde248b70b43772eb177185232960 | [
"MIT"
] | null | null | null | EDX_quant_main.py | tkcroat/EDX | f447dfbc0b7cde248b70b43772eb177185232960 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Jul 11 15:07:07 2016
@author: tkc
"""
import pandas as pd
import os, sys, glob
if 'C:\\Users\\tkc\\Documents\\Python_Scripts\\EDX' not in sys.path:
sys.path.append('C:\\Users\\tkc\\Documents\\Python_Scripts\\EDX')
if 'C:\\Users\\tkc\\Documents\\Python_Scripts\\Utilities'... | 44.935361 | 138 | 0.765104 |
696c2383099ee72f0b2c7a08aafe5b115aabf835 | 4,631 | py | Python | temboo/core/proxy.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 7 | 2016-03-07T02:07:21.000Z | 2022-01-21T02:22:41.000Z | temboo/core/proxy.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | null | null | null | temboo/core/proxy.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 8 | 2016-06-14T06:01:11.000Z | 2020-04-22T09:21:44.000Z | ###############################################################################
#
# temboo.core.proxy.TembooProxy
# temboo.core.proxy.TembooProxifiedChoreography
#
# Classes to proxy choreo execution requests made from the JavaScript SDK
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed und... | 33.316547 | 112 | 0.715396 |
4184aecd870ac5f3b2ab06fa2d778701088dd5d5 | 684 | py | Python | Queue, Deques and Stacks/implement_a_stack.py | Dannark/Data-Structure-and-Algorithms | 93cb7ec813db3f6617e95d47f9e13fd2f90d3fb4 | [
"MIT"
] | 3 | 2020-09-25T02:11:26.000Z | 2020-11-03T07:47:19.000Z | Queue, Deques and Stacks/implement_a_stack.py | Dannark/Data-Structure-and-Algorithms | 93cb7ec813db3f6617e95d47f9e13fd2f90d3fb4 | [
"MIT"
] | null | null | null | Queue, Deques and Stacks/implement_a_stack.py | Dannark/Data-Structure-and-Algorithms | 93cb7ec813db3f6617e95d47f9e13fd2f90d3fb4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Implement a Stack.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1xWpRVXbn8-H67jgqJgfrmefsI8cYnCL5
"""
class Stack(object):
def __init__(self):
self.items = []
def enqueue(self, item):
self.items.append(it... | 17.538462 | 77 | 0.659357 |
3504e194284d3d0e947827bcbc6cda6fc33a00b1 | 554 | py | Python | spider/adt/test_adt.py | UAws/myadelaide-timetable-synchronizer | 8cee9c895a7916cd035785cd2fa6f0a3a3d2235d | [
"MIT"
] | 6 | 2022-02-25T06:59:06.000Z | 2022-02-27T09:29:32.000Z | spider/adt/test_adt.py | UAws/myadelaide-timetable-synchronizer | 8cee9c895a7916cd035785cd2fa6f0a3a3d2235d | [
"MIT"
] | null | null | null | spider/adt/test_adt.py | UAws/myadelaide-timetable-synchronizer | 8cee9c895a7916cd035785cd2fa6f0a3a3d2235d | [
"MIT"
] | 2 | 2022-02-25T07:52:57.000Z | 2022-02-28T10:27:43.000Z | from unittest import TestCase
from spider.adt.adt import generate_schemes, course_abstract_data_type, generate_schemes_by_jtd_codegen, \
jwt_token_abstract_data_type
class Test(TestCase):
def test_generate_schemes(self):
print(generate_schemes(json_data=course_abstract_data_type))
def test_gener... | 34.625 | 106 | 0.814079 |
e55a0a1e35b504f87ac8f7ab7570198cbdcdda32 | 932 | py | Python | python-kiwoom-api/basic/section01/unit06/exercise/kiwoom.py | sharebook-kr/learningspoons-bootcamp-finance | 0288f3f3b39f54420e4e9987f1de12892dc680ea | [
"MIT"
] | 9 | 2020-10-25T15:13:32.000Z | 2022-03-26T11:27:21.000Z | python-kiwoom-api/basic/section01/unit06/exercise/kiwoom.py | sharebook-kr/learningspoons-bootcamp-finance | 0288f3f3b39f54420e4e9987f1de12892dc680ea | [
"MIT"
] | null | null | null | python-kiwoom-api/basic/section01/unit06/exercise/kiwoom.py | sharebook-kr/learningspoons-bootcamp-finance | 0288f3f3b39f54420e4e9987f1de12892dc680ea | [
"MIT"
] | 7 | 2021-03-01T11:06:45.000Z | 2022-03-14T07:06:04.000Z | import sys
from PyQt5.QtWidgets import *
from PyQt5.QAxContainer import *
from PyQt5.QtCore import *
class Kiwoom:
def __init__(self):
self.ocx = QAxWidget("KHOPENAPI.KHOpenAPICtrl.1")
self.ocx.OnEventConnect.connect(self._handler_login)
def CommConnect(self):
self.ocx.dynamicCall("Co... | 26.628571 | 75 | 0.666309 |
047a81770cd876c014331eef71250c93287588e4 | 534 | py | Python | workers/Grab_ms_data_worker.py | Ren22/1c_gui_complete | 77b7a04d995c4d5f721ba7efe2bc86dda78c4378 | [
"Apache-2.0"
] | null | null | null | workers/Grab_ms_data_worker.py | Ren22/1c_gui_complete | 77b7a04d995c4d5f721ba7efe2bc86dda78c4378 | [
"Apache-2.0"
] | 6 | 2019-02-01T10:40:20.000Z | 2022-03-11T23:45:03.000Z | workers/Grab_ms_data_worker.py | Ren22/1c_gui_complete | 77b7a04d995c4d5f721ba7efe2bc86dda78c4378 | [
"Apache-2.0"
] | null | null | null | from PyQt5.QtCore import Qt, pyqtSignal, QObject
from pipelineController import *
class GrabMSDataWorker(QObject):
progressBarSig = pyqtSignal(int)
pipeStatusToLogger = pyqtSignal(str)
changeTabSig = pyqtSignal()
incrementStepSig = pyqtSignal()
grab_ms_data = GrabMsData()
def __init__(self):... | 25.428571 | 48 | 0.700375 |
cb9e236895d94c914b74b94f2bed504f06e5ba85 | 58,326 | py | Python | catalyst/testing/fixtures.py | guilhermeprokisch/catalyst | 21e096b261912d9e905584178d6ee626072c23cb | [
"Apache-2.0"
] | null | null | null | catalyst/testing/fixtures.py | guilhermeprokisch/catalyst | 21e096b261912d9e905584178d6ee626072c23cb | [
"Apache-2.0"
] | null | null | null | catalyst/testing/fixtures.py | guilhermeprokisch/catalyst | 21e096b261912d9e905584178d6ee626072c23cb | [
"Apache-2.0"
] | null | null | null | import os
import sqlite3
from unittest import TestCase
from contextlib2 import ExitStack
from logbook import NullHandler, Logger
from six import with_metaclass, iteritems
from toolz import flip
import pandas as pd
import responses
from .core import (
create_daily_bar_data,
create_minute_bar_data,... | 37.508682 | 80 | 0.660906 |
746a30e2474d64cca5e411653ebc7c38898397e1 | 2,749 | py | Python | eth/beacon/types/validator_records.py | jvmaia/py-evm | d82b10ae361cde6abbac62f171fcea7809c4e3cf | [
"MIT"
] | null | null | null | eth/beacon/types/validator_records.py | jvmaia/py-evm | d82b10ae361cde6abbac62f171fcea7809c4e3cf | [
"MIT"
] | null | null | null | eth/beacon/types/validator_records.py | jvmaia/py-evm | d82b10ae361cde6abbac62f171fcea7809c4e3cf | [
"MIT"
] | null | null | null | from eth_typing import (
Hash32,
)
import rlp
from eth.beacon.enums import (
ValidatorStatusCode,
)
from eth.rlp.sedes import (
uint64,
uint384,
hash32,
)
VALIDATOR_RECORD_ACTIVE_STATUSES = {
ValidatorStatusCode.ACTIVE,
ValidatorStatusCode.ACTIVE_PENDING_EXIT,
}
class ValidatorRecord(rl... | 29.880435 | 83 | 0.574754 |
77b306246dc2a266ac25137801865f5560c7d666 | 1,632 | py | Python | setup.py | tsufeki/python-restclientaio | 2af2ded9e22ba5552ace193691ed3a4b520cadf8 | [
"BSD-2-Clause"
] | null | null | null | setup.py | tsufeki/python-restclientaio | 2af2ded9e22ba5552ace193691ed3a4b520cadf8 | [
"BSD-2-Clause"
] | null | null | null | setup.py | tsufeki/python-restclientaio | 2af2ded9e22ba5552ace193691ed3a4b520cadf8 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
import io
import re
from glob import glob
from os.path import basename, dirname, join, splitext
from setuptools import find_packages, setup
def read(*names, **kwargs):
return io.open(
join(dirname(__file__), *names),
encoding=kwargs.get('encoding', 'utf8'),
).read()
... | 28.631579 | 74 | 0.58701 |
071da22d636a9afe5fd4e7c575d8d87364d69d46 | 34 | py | Python | pybrain/__init__.py | rueckstiess/pybrain | 8fc950d700aaf9d5012911d53714afb4b18225c3 | [
"BSD-3-Clause"
] | 3 | 2015-03-21T21:42:28.000Z | 2018-07-12T04:21:32.000Z | pybrain/__init__.py | bayerj/pybrain | cfef28152bd60cedfdae5390c599d4fe4d2ec095 | [
"BSD-3-Clause"
] | null | null | null | pybrain/__init__.py | bayerj/pybrain | cfef28152bd60cedfdae5390c599d4fe4d2ec095 | [
"BSD-3-Clause"
] | null | null | null | from structure.__init__ import *
| 17 | 33 | 0.794118 |
5e7f668a18b915e1229b7e19ad1bc54ee018f898 | 2,085 | py | Python | src/106a/src/obstacle_brain.py | 106aRoboCupSim/simatch | a5dc4c3ff43482a0e303c4db883ade7ec6d11613 | [
"Apache-2.0"
] | 1 | 2021-11-01T17:26:53.000Z | 2021-11-01T17:26:53.000Z | src/106a/src/obstacle_brain.py | 106aRoboCupSim/simatch | a5dc4c3ff43482a0e303c4db883ade7ec6d11613 | [
"Apache-2.0"
] | null | null | null | src/106a/src/obstacle_brain.py | 106aRoboCupSim/simatch | a5dc4c3ff43482a0e303c4db883ade7ec6d11613 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import rospy
import sys
import time
import numpy as np
from realtimepseudoAstar import plan
from globaltorobotcoords import transform
from nubot_common.msg import ActionCmd, VelCmd, OminiVisionInfo, BallInfo, ObstaclesInfo, RobotInfo, BallIsHolding
#Initialize desired x depending on obstacle num... | 29.366197 | 115 | 0.710312 |
3f277a74d74d141305ad5d1de7e9fdd21ba4e7b5 | 22,005 | py | Python | webware/WebUtils/HTMLTag.py | WebwareForPython/w4py3 | 9902798141c6c568302e7cb11eb3a36384809f86 | [
"MIT"
] | 11 | 2020-10-18T07:33:56.000Z | 2021-09-27T21:03:38.000Z | webware/WebUtils/HTMLTag.py | WebwareForPython/w4py3 | 9902798141c6c568302e7cb11eb3a36384809f86 | [
"MIT"
] | 4 | 2020-10-17T12:03:50.000Z | 2022-03-10T21:13:18.000Z | webware/WebUtils/HTMLTag.py | WebwareForPython/w4py3 | 9902798141c6c568302e7cb11eb3a36384809f86 | [
"MIT"
] | 4 | 2020-06-30T09:41:56.000Z | 2021-02-20T13:48:08.000Z | """HTMLTag.py
HTMLTag defines a class of the same name that represents HTML content.
An additional HTMLReader class kicks off the process of reading an HTML
file into a set of tags::
from WebUtils.HTMLTag import HTMLReader
reader = HTMLReader()
tag = reader.readFileNamed('foo.html')
tag.pprint()
Tags... | 31.753247 | 79 | 0.613315 |
c72ee0411e3cc7cbcd77a197fa54aac10230eb61 | 4,076 | py | Python | build-scripts/enable_derivatives.py | amdonov/content | 9aa34dcff8a753a985809298b2176070e866fc7b | [
"BSD-3-Clause"
] | 1 | 2021-02-10T20:03:42.000Z | 2021-02-10T20:03:42.000Z | build-scripts/enable_derivatives.py | amdonov/content | 9aa34dcff8a753a985809298b2176070e866fc7b | [
"BSD-3-Clause"
] | 30 | 2020-06-29T13:15:41.000Z | 2021-01-18T13:51:49.000Z | build-scripts/enable_derivatives.py | amdonov/content | 9aa34dcff8a753a985809298b2176070e866fc7b | [
"BSD-3-Clause"
] | 1 | 2021-06-16T08:07:30.000Z | 2021-06-16T08:07:30.000Z | #!/usr/bin/env python2
from __future__ import print_function
"""
Takes given XCCDF or DataStream and adds RHEL derivative operating system(s) CPE name next
to RHEL CPE names. Can automatically recognize RHEL CPEs and adds the derivitive OS ones
next to those accordingly.
Apart from adding the CPEs it adds a notice i... | 33.409836 | 126 | 0.673209 |
147d97ca77b4d351138d3b0bd9781e1096f186d8 | 751 | py | Python | apps/feed_import/urls.py | BenoitZugmeyer/NewsBlur | 8d63f2598fa83245d381933d552ca490d84df526 | [
"MIT"
] | 2 | 2015-09-05T10:40:30.000Z | 2017-03-05T12:31:21.000Z | apps/feed_import/urls.py | BenoitZugmeyer/NewsBlur | 8d63f2598fa83245d381933d552ca490d84df526 | [
"MIT"
] | 7 | 2021-02-08T20:32:31.000Z | 2022-03-11T23:50:47.000Z | apps/feed_import/urls.py | BenoitZugmeyer/NewsBlur | 8d63f2598fa83245d381933d552ca490d84df526 | [
"MIT"
] | 1 | 2021-09-27T06:02:59.000Z | 2021-09-27T06:02:59.000Z | from django.conf.urls import *
from apps.feed_import import views
urlpatterns = patterns('apps.feed_import.views',
url(r'^opml_upload/?$', views.opml_upload, name='opml-upload'),
url(r'^opml_export/?$', views.opml_export, name='opml-export'),
url(r'^authorize/?$', views.reader_authorize, name='google-reade... | 57.769231 | 156 | 0.743009 |
c3f3006ef293e4e31c671cfddf098174406bb704 | 3,407 | py | Python | barf/arch/x86/disassembler.py | Cyb3rDo/barf-project | df7359b7689f3282cdf900358bf2519d7f6c1da4 | [
"BSD-2-Clause"
] | 1 | 2018-12-14T13:41:37.000Z | 2018-12-14T13:41:37.000Z | barf/arch/x86/disassembler.py | Cyb3rDo/barf-project | df7359b7689f3282cdf900358bf2519d7f6c1da4 | [
"BSD-2-Clause"
] | null | null | null | barf/arch/x86/disassembler.py | Cyb3rDo/barf-project | df7359b7689f3282cdf900358bf2519d7f6c1da4 | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2014, Fundacion Dr. Manuel Sadosky
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this
# list of condit... | 35.489583 | 80 | 0.706193 |
dbd38c504dcd928d7bb21bfe1d04134119a1e87f | 1,763 | py | Python | kale/types/blockchain_format/tree_hash.py | grayfallstown/kale-blockchain | 1c426a15967813ece30f77b9b7584f2dc5ed554a | [
"Apache-2.0"
] | 23 | 2021-07-05T00:55:47.000Z | 2022-02-09T04:30:08.000Z | kale/types/blockchain_format/tree_hash.py | grayfallstown/kale-blockchain | 1c426a15967813ece30f77b9b7584f2dc5ed554a | [
"Apache-2.0"
] | 14 | 2021-07-05T13:08:25.000Z | 2021-08-23T18:57:02.000Z | kale/types/blockchain_format/tree_hash.py | grayfallstown/kale-blockchain | 1c426a15967813ece30f77b9b7584f2dc5ed554a | [
"Apache-2.0"
] | 5 | 2021-07-06T23:24:39.000Z | 2022-03-15T08:43:03.000Z | """
This is an implementation of `sha256_treehash`, used to calculate
puzzle hashes in clvm.
This implementation goes to great pains to be non-recursive so we don't
have to worry about blowing out the python stack.
"""
from typing import Optional, Set
from clvm import CLVMObject
from kale.types.blockchain_format.si... | 29.881356 | 95 | 0.633579 |
d51375358eb5a1963dbabc90d2d4e554fbad7db5 | 1,468 | py | Python | gdsfactory/simulation/lumerical/write_sparameters_lumerical_components.py | jorgepadilla19/gdsfactory | 68e1c18257a75d4418279851baea417c8899a165 | [
"MIT"
] | null | null | null | gdsfactory/simulation/lumerical/write_sparameters_lumerical_components.py | jorgepadilla19/gdsfactory | 68e1c18257a75d4418279851baea417c8899a165 | [
"MIT"
] | null | null | null | gdsfactory/simulation/lumerical/write_sparameters_lumerical_components.py | jorgepadilla19/gdsfactory | 68e1c18257a75d4418279851baea417c8899a165 | [
"MIT"
] | null | null | null | """Write Sparameters with for different components."""
from typing import Optional
from tqdm import tqdm
from gdsfactory.simulation.lumerical.write_sparameters_lumerical import (
write_sparameters_lumerical,
)
from gdsfactory.types import ComponentOrFactory, List
def write_sparameters_lumerical_components(
... | 30.583333 | 82 | 0.692779 |
6ee78b1aaccc3e030fbf67dbe1abd0b15c2ec7ba | 3,570 | py | Python | paas-ce/paas/esb/components/bk/apisv2/cc/create_business.py | canway-bk/bk-PaaS | 7a6fe1ef38a7e4e2bd11a6c2efa871a967ac2a3c | [
"Apache-2.0"
] | 767 | 2019-03-25T06:35:43.000Z | 2022-03-30T08:57:51.000Z | paas-ce/paas/esb/components/bk/apisv2/cc/create_business.py | canway-bk/bk-PaaS | 7a6fe1ef38a7e4e2bd11a6c2efa871a967ac2a3c | [
"Apache-2.0"
] | 194 | 2019-03-29T07:16:41.000Z | 2022-03-30T06:17:49.000Z | paas-ce/paas/esb/components/bk/apisv2/cc/create_business.py | canway-bk/bk-PaaS | 7a6fe1ef38a7e4e2bd11a6c2efa871a967ac2a3c | [
"Apache-2.0"
] | 381 | 2019-03-25T07:19:54.000Z | 2022-03-29T03:22:42.000Z | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 33.364486 | 305 | 0.531933 |
9b92af6fbec296b2590962d6ddf8c58c37f50fa6 | 10,240 | py | Python | src/dataloader.py | kahrabian/RT-X | 7b30fe27ee6dbf073c60da996323ee21b8d750b1 | [
"MIT"
] | 4 | 2020-11-18T12:34:09.000Z | 2021-07-18T15:03:21.000Z | src/dataloader.py | kahrabian/RT-X | 7b30fe27ee6dbf073c60da996323ee21b8d750b1 | [
"MIT"
] | null | null | null | src/dataloader.py | kahrabian/RT-X | 7b30fe27ee6dbf073c60da996323ee21b8d750b1 | [
"MIT"
] | 2 | 2021-06-08T05:51:53.000Z | 2022-03-02T16:51:09.000Z | import bisect
import calendar
import pytz
from datetime import datetime
import numpy as np
import pandas as pd
import torch
from torch.utils.data import Dataset
class TrainDataset(Dataset):
@staticmethod
def _frq(tup, start=4):
frq = {}
for s, r, o, _ in tup:
if (s, r) not in frq:... | 38.787879 | 121 | 0.555859 |
a7f8c2fa75a0b25bfbef37b5bcf910754795d5de | 789 | py | Python | ex21.py | rishabhgautam/LPTHW_mynotes | eb462926ab924ea1096e0e81125e94f338b2ddd2 | [
"MIT"
] | 2 | 2021-03-07T17:13:49.000Z | 2022-03-29T08:55:17.000Z | ex21.py | rishabhgautam/LPTHW_mynotes | eb462926ab924ea1096e0e81125e94f338b2ddd2 | [
"MIT"
] | 1 | 2021-06-10T20:17:55.000Z | 2021-06-10T20:17:55.000Z | Learn-Python-The-Hard-Way/Python3/ex21.py | QuantFinEcon/py-learn | 7151f01df9f7f096312e43434fe8026d1d7d7828 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# ex21: Functions Can Return Something
def add(a, b):
print("ADDING %d + %d" % (a, b))
return a + b
def subtract(a, b):
print("SUBTRACTING %d - %d" % (a, b))
return a - b
def multiply(a, b):
print("MULTIPLYING %d * %d" % (a, b))
return a * b
def divide(a, b):
prin... | 21.916667 | 76 | 0.594423 |
ff0acde5c9d78a0a80ccb18d4e3a2e59b2a8d3ce | 3,708 | py | Python | src/ml_gym/data_handling/dataset_loader.py | SofiaTraba/mlgym | 3ececb4dcaa32119ced20987b81bd790303e7cb7 | [
"Apache-2.0"
] | 6 | 2020-11-28T16:56:01.000Z | 2022-01-06T12:49:12.000Z | src/ml_gym/data_handling/dataset_loader.py | SofiaTraba/mlgym | 3ececb4dcaa32119ced20987b81bd790303e7cb7 | [
"Apache-2.0"
] | 6 | 2020-12-18T14:51:43.000Z | 2021-12-01T17:20:55.000Z | src/ml_gym/data_handling/dataset_loader.py | SofiaTraba/mlgym | 3ececb4dcaa32119ced20987b81bd790303e7cb7 | [
"Apache-2.0"
] | 2 | 2021-11-16T08:47:36.000Z | 2022-01-06T12:49:15.000Z | from torch.utils.data import DataLoader
from torch.utils.data.sampler import RandomSampler, WeightedRandomSampler
from typing import Callable, Dict, List
from data_stack.dataset.iterator import InformedDatasetIteratorIF
from torch.utils.data.sampler import Sampler
from collections import Counter
import torch
from ml_gy... | 48.789474 | 156 | 0.688242 |
4fbaae3521a9350d53a07da405bb1a1c2dc4d025 | 1,468 | py | Python | src/streamlink/plugins/zengatv.py | gromit1811/streamlink | ad95081e894316e154800cecf1c7b5e7062535f3 | [
"BSD-2-Clause"
] | null | null | null | src/streamlink/plugins/zengatv.py | gromit1811/streamlink | ad95081e894316e154800cecf1c7b5e7062535f3 | [
"BSD-2-Clause"
] | null | null | null | src/streamlink/plugins/zengatv.py | gromit1811/streamlink | ad95081e894316e154800cecf1c7b5e7062535f3 | [
"BSD-2-Clause"
] | null | null | null | import logging
import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import useragents
from streamlink.stream import HLSStream
log = logging.getLogger(__name__)
class ZengaTV(Plugin):
"""Streamlink Plugin for livestreams on zengatv.com"""
_url_re = re.compile(r"https?://(www\.)?zengatv... | 28.784314 | 104 | 0.598093 |
bb625a6f92387a0838a0c441e032aebffcd13828 | 3,111 | py | Python | data/cirq_new/cirq_program/startCirq_pragma944.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/cirq_new/cirq_program/startCirq_pragma944.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/cirq_new/cirq_program/startCirq_pragma944.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=4
# total number=24
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
class Opty(cirq.PointOptimizer):
def optimization_at(
... | 34.955056 | 92 | 0.650916 |
79636cb611d0bd0a36b8203d89b9d4d6fde812c7 | 37 | py | Python | tests/__init__.py | allegheny-computer-science-203-s2021/PytestPlugin-Team7 | 6ea2ec6a5368313061f4553501dfc7f7ad207981 | [
"MIT"
] | null | null | null | tests/__init__.py | allegheny-computer-science-203-s2021/PytestPlugin-Team7 | 6ea2ec6a5368313061f4553501dfc7f7ad207981 | [
"MIT"
] | null | null | null | tests/__init__.py | allegheny-computer-science-203-s2021/PytestPlugin-Team7 | 6ea2ec6a5368313061f4553501dfc7f7ad207981 | [
"MIT"
] | 1 | 2021-05-21T01:37:44.000Z | 2021-05-21T01:37:44.000Z | """Empty file required by pylint."""
| 18.5 | 36 | 0.675676 |
ebbfaa9f143ad86dcd3c0d1c4c3f45995ecbb7df | 565 | py | Python | var/spack/repos/builtin/packages/perl-number-format/package.py | jameshclrk/spack | 1f8fcb36091e1d5ae63a2279a958ca3ff57088bf | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2021-03-19T13:12:47.000Z | 2021-03-19T13:12:47.000Z | var/spack/repos/builtin/packages/perl-number-format/package.py | jameshclrk/spack | 1f8fcb36091e1d5ae63a2279a958ca3ff57088bf | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2019-01-11T20:11:52.000Z | 2019-01-11T20:11:52.000Z | var/spack/repos/builtin/packages/perl-number-format/package.py | jameshclrk/spack | 1f8fcb36091e1d5ae63a2279a958ca3ff57088bf | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-10-14T14:20:17.000Z | 2020-10-14T14:20:17.000Z | # Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PerlNumberFormat(PerlPackage):
"""Number::Format - Perl extension for formatting numbers""... | 35.3125 | 94 | 0.748673 |
0519aacafe0548d888e22fd2a48c7e507644a733 | 911 | py | Python | setup.py | zhimiaoli/dailyblink | a8d2f863d7e82d861905882924adb513b00653c3 | [
"MIT"
] | 25 | 2020-05-01T16:34:11.000Z | 2022-02-19T09:39:20.000Z | setup.py | zhimiaoli/dailyblink | a8d2f863d7e82d861905882924adb513b00653c3 | [
"MIT"
] | 24 | 2020-12-07T21:07:11.000Z | 2022-03-15T18:18:00.000Z | setup.py | zhimiaoli/dailyblink | a8d2f863d7e82d861905882924adb513b00653c3 | [
"MIT"
] | 6 | 2021-03-05T09:19:37.000Z | 2022-01-01T08:25:14.000Z | import codecs
import os
import re
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
def read(*parts):
with codecs.open(os.path.join(here, *parts), "r") as fp:
return fp.read()
def find_version(*file_paths):
version_file = read(*file_paths)
version_ma... | 26.794118 | 88 | 0.678375 |
ded0ad2f937fb3c9f08daafa85865ee7e644210d | 3,230 | py | Python | data/external/repositories_2to3/202553/Grasp-and-Lift-master/carl/nn2/stacknn2sub.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories_2to3/202553/Grasp-and-Lift-master/carl/nn2/stacknn2sub.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories_2to3/202553/Grasp-and-Lift-master/carl/nn2/stacknn2sub.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | 1 | 2019-12-04T08:23:33.000Z | 2019-12-04T08:23:33.000Z | from xgb_classifier import xgb_classifier
import pandas as pd
import numpy as np
from sklearn.cross_validation import KFold
from sklearn import preprocessing
from collections import Counter
from sklearn import metrics
import h5py
########################################
# this stacking uses the base model va... | 26.048387 | 101 | 0.593189 |
686a7c5d66580da73ddafd2810283a3a0c830e56 | 20,051 | py | Python | dec/test.py | tknapen/decode_encode | bc8d86281837fbbe611a1a32fa9175448b2ada2b | [
"MIT"
] | 4 | 2017-08-22T11:08:24.000Z | 2019-05-01T11:04:56.000Z | dec/test.py | tknapen/decode_encode | bc8d86281837fbbe611a1a32fa9175448b2ada2b | [
"MIT"
] | null | null | null | dec/test.py | tknapen/decode_encode | bc8d86281837fbbe611a1a32fa9175448b2ada2b | [
"MIT"
] | null | null | null | ############################################################################################################################################
# imports
############################################################################################################################################
import numpy as np
import... | 50.002494 | 194 | 0.670291 |
06b89e5bba7101e44b5d1475a65ba9e0e2e61f70 | 1,189 | py | Python | model/res_stack.py | jinny1208/MelGAN | 2b76b56dc22210febd1a4cc9cd5dfe5f01410231 | [
"BSD-3-Clause"
] | 2 | 2022-03-24T10:01:49.000Z | 2022-03-25T07:43:13.000Z | model/res_stack.py | jinny1208/MelGAN | 2b76b56dc22210febd1a4cc9cd5dfe5f01410231 | [
"BSD-3-Clause"
] | null | null | null | model/res_stack.py | jinny1208/MelGAN | 2b76b56dc22210febd1a4cc9cd5dfe5f01410231 | [
"BSD-3-Clause"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
class ResStack(nn.Module):
def __init__(self, channel, dilation=1):
super(ResStack, self).__init__()
self.block = nn.Sequential(
nn.LeakyReLU(0.2),
nn.ReflectionPad1d(dilation),
... | 33.027778 | 100 | 0.600505 |
c4082ee92b79f5bb53525f8a88e4f266a1ecc745 | 759 | py | Python | chat/__init__.py | shahmeernavid/webrtc-chat | 529d0fd2766d148857d024561cf51a071b6bb3e8 | [
"MIT"
] | null | null | null | chat/__init__.py | shahmeernavid/webrtc-chat | 529d0fd2766d148857d024561cf51a071b6bb3e8 | [
"MIT"
] | null | null | null | chat/__init__.py | shahmeernavid/webrtc-chat | 529d0fd2766d148857d024561cf51a071b6bb3e8 | [
"MIT"
] | null | null | null | from flask import Flask, redirect, render_template, url_for, jsonify, request, make_response
from flask.ext.socketio import SocketIO, send, emit
app = Flask(__name__, static_url_path='')
from chat import views
# socketio = SocketIO(app)
# m = {
# "message": "some string"
# }
# #app.config['SECRET_KEY'] = 'secret... | 26.172414 | 98 | 0.665349 |
cfff87e30e0cc787c100e7bab5f5b4366876bfd7 | 3,600 | py | Python | configs/recognition/tsm_custom/tsm_r50_dense_1x1x8_50e_customdataset_fight_rgb.py | ZJU-lishuang/mmaction2 | dc46505319968eff0123eb5abb811969042377c5 | [
"Apache-2.0"
] | 2 | 2021-12-07T09:09:10.000Z | 2022-01-26T01:52:07.000Z | configs/recognition/tsm_custom/tsm_r50_dense_1x1x8_50e_customdataset_fight_rgb.py | ZJU-lishuang/mmaction2 | dc46505319968eff0123eb5abb811969042377c5 | [
"Apache-2.0"
] | null | null | null | configs/recognition/tsm_custom/tsm_r50_dense_1x1x8_50e_customdataset_fight_rgb.py | ZJU-lishuang/mmaction2 | dc46505319968eff0123eb5abb811969042377c5 | [
"Apache-2.0"
] | null | null | null | _base_ = [
'../../_base_/models/tsm_r50.py', '../../_base_/schedules/sgd_tsm_50e.py',
'../../_base_/default_runtime.py'
]
# model settings
model = dict(backbone=dict(pretrained='weight/resnet50-19c8e357.pth'),cls_head=dict(num_classes=2))
log_config = dict(
interval=1,
hooks=[
dict(type='TextLo... | 33.027523 | 99 | 0.66 |
2caa1382861f4a6816b455c81f66d5f585ac6104 | 7,728 | py | Python | mcf/mcf_loccent_functions.py | MCFpy/mcf | dac9056ed63620e3225903582d50e89af87b6896 | [
"MIT"
] | 4 | 2021-06-19T08:27:17.000Z | 2022-01-27T17:51:39.000Z | mcf/mcf_loccent_functions.py | MCFpy/mcf | dac9056ed63620e3225903582d50e89af87b6896 | [
"MIT"
] | 1 | 2021-07-21T11:40:50.000Z | 2021-08-13T11:14:12.000Z | mcf/mcf_loccent_functions.py | MCFpy/mcf | dac9056ed63620e3225903582d50e89af87b6896 | [
"MIT"
] | 2 | 2021-11-05T08:08:21.000Z | 2022-03-19T15:39:09.000Z | """
Procedures needed for ATE estimation.
Created on Thu Dec 8 15:48:57 2020.
@author: MLechner
# -*- coding: utf-8 -*-
"""
import copy
import pandas as pd
import numpy as np
from mcf import general_purpose as gp
from mcf import general_purpose_estimation as gp_est
def local_centering_new_sample(lc_csvfile, nonlc... | 41.548387 | 77 | 0.635999 |
90a5e3be533cb510b0646aaa0e5f86cebc8aa930 | 27,443 | py | Python | electrum/util.py | akhil2015/electrum | b5d637aeaeb6bf9a168baed9704ff3a5eb1822c0 | [
"MIT"
] | null | null | null | electrum/util.py | akhil2015/electrum | b5d637aeaeb6bf9a168baed9704ff3a5eb1822c0 | [
"MIT"
] | null | null | null | electrum/util.py | akhil2015/electrum | b5d637aeaeb6bf9a168baed9704ff3a5eb1822c0 | [
"MIT"
] | null | null | null | # Electrum - lightweight Bitcoin client
# Copyright (C) 2011 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights t... | 30.357301 | 119 | 0.610174 |
3d1aaf7ed951455d96e6ec35c9b8ee480ef06513 | 2,067 | py | Python | pincer/objects/guild/__init__.py | Kylianalex/Pincer | 7ca530798a696c70e7d5c939902653575e3d8054 | [
"MIT"
] | 2 | 2021-11-09T13:07:09.000Z | 2021-11-11T22:30:12.000Z | pincer/objects/guild/__init__.py | Kylianalex/Pincer | 7ca530798a696c70e7d5c939902653575e3d8054 | [
"MIT"
] | 1 | 2021-12-28T07:05:33.000Z | 2021-12-28T07:08:02.000Z | pincer/objects/guild/__init__.py | Kylianalex/Pincer | 7ca530798a696c70e7d5c939902653575e3d8054 | [
"MIT"
] | null | null | null | # Copyright Pincer 2021-Present
# Full MIT License can be found in `LICENSE` at the project root.
from .audit_log import (
AuditLogEvent, AuditLogChange, AuditEntryInfo, AuditLogEntry, AuditLog
)
from .ban import Ban
from .channel import (
ChannelType, Channel, TextChannel, VoiceChannel, CategoryChannel,
N... | 43.0625 | 88 | 0.779874 |
ce4d38d97f2f262e0ed98446b7a8a512cd7cf4e5 | 5,771 | py | Python | pluto/strategies/strategies.py | chalant/pluto | e7bfd35a2c1fc0e0753bd2f840b0a4385b5124fc | [
"Apache-2.0"
] | null | null | null | pluto/strategies/strategies.py | chalant/pluto | e7bfd35a2c1fc0e0753bd2f840b0a4385b5124fc | [
"Apache-2.0"
] | null | null | null | pluto/strategies/strategies.py | chalant/pluto | e7bfd35a2c1fc0e0753bd2f840b0a4385b5124fc | [
"Apache-2.0"
] | null | null | null | import hashlib
import os
from sqlalchemy import text, func
from pluto.strategies import sessions
from pluto.universes import universes
_ADD_STRATEGY = text(
"""
INSERT INTO strategies (strategy_id, strategy_name, status)
VALUES (:strategy_id, :strategy_name, :status)
"""
)
_ADD_STRATEGY_SESSION = t... | 23.364372 | 105 | 0.652053 |
d1e9fdc85095d96164d8391f591191f3d8b2ef44 | 944 | py | Python | apps/recurring_donations/tests/model_factory.py | jfterpstra/onepercentclub-site | 43e8e01ac4d3d1ffdd5959ebd048ce95bb2dba0e | [
"BSD-3-Clause"
] | 7 | 2015-01-02T19:31:14.000Z | 2021-03-22T17:30:23.000Z | apps/recurring_donations/tests/model_factory.py | jfterpstra/onepercentclub-site | 43e8e01ac4d3d1ffdd5959ebd048ce95bb2dba0e | [
"BSD-3-Clause"
] | 1 | 2015-03-06T08:34:59.000Z | 2015-03-06T08:34:59.000Z | apps/recurring_donations/tests/model_factory.py | jfterpstra/onepercentclub-site | 43e8e01ac4d3d1ffdd5959ebd048ce95bb2dba0e | [
"BSD-3-Clause"
] | null | null | null | import factory
from apps.recurring_donations.models import MonthlyDonor, MonthlyDonorProject
from bluebottle.test.factory_models.accounts import BlueBottleUserFactory
from bluebottle.test.factory_models.geo import CountryFactory
from onepercentclub.tests.factory_models.project_factories import OnePercentProjectFactory
... | 33.714286 | 90 | 0.795551 |
e6140889640c305ed293d90538a505f5e852b156 | 194 | py | Python | alfredworkflow/settings.py | ktal90/SmartThings-Alfred | b30bbd27982533daf0eb556e48ce673ec11ebdf1 | [
"MIT"
] | 2 | 2019-10-23T13:28:54.000Z | 2022-01-26T02:37:25.000Z | alfredworkflow/settings.py | ktal90/SmartThings-Alfred | b30bbd27982533daf0eb556e48ce673ec11ebdf1 | [
"MIT"
] | null | null | null | alfredworkflow/settings.py | ktal90/SmartThings-Alfred | b30bbd27982533daf0eb556e48ce673ec11ebdf1 | [
"MIT"
] | 2 | 2019-11-12T06:46:10.000Z | 2022-01-12T19:57:42.000Z | PROTOCOL = "https"
HOSTNAME = "graph.api.smartthings.com"
PORT = 443
SERVER_PORT = 2222
CLIENT_ID = 'cb87b758-af81-11e2-981c-9989e5deaab7'
CLIENT_SECRET = 'e06c70fa-af81-11e2-981c-9989e5deaab7'
| 27.714286 | 54 | 0.778351 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.