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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f71d5cefc3da853120a2daae786970fa0e13e6a6 | 5,995 | py | Python | basis_set_exchange/cli/bsecurate_cli.py | atomse/basis_set_exchange | 7ffd64082c14d2f61eb43f1c2d44792e8b0e394e | [
"BSD-3-Clause"
] | null | null | null | basis_set_exchange/cli/bsecurate_cli.py | atomse/basis_set_exchange | 7ffd64082c14d2f61eb43f1c2d44792e8b0e394e | [
"BSD-3-Clause"
] | null | null | null | basis_set_exchange/cli/bsecurate_cli.py | atomse/basis_set_exchange | 7ffd64082c14d2f61eb43f1c2d44792e8b0e394e | [
"BSD-3-Clause"
] | null | null | null | '''
Command line interface for the basis set exchange
'''
import argparse
import argcomplete
from .. import version
from .bsecurate_handlers import bsecurate_cli_handle_subcmd
from .check import cli_check_normalize_args
from .complete import cli_case_insensitive_validator, cli_bsname_completer, cli_readerfmt_completer... | 52.130435 | 148 | 0.629191 |
import argparse
import argcomplete
from .. import version
from .bsecurate_handlers import bsecurate_cli_handle_subcmd
from .check import cli_check_normalize_args
from .complete import cli_case_insensitive_validator, cli_bsname_completer, cli_readerfmt_completer
def run_bsecurate_cli():
ding png file')
subp.a... | true | true |
f71d5cf776ccdf11c1fcda67f525c795c730a062 | 1,006 | py | Python | listWmflabsdotorgRecordsets.py | Krenair/wmcs-misc-scripts | ae91b5756d73a9405634df9d6c32e98f21b97d5f | [
"Apache-2.0"
] | null | null | null | listWmflabsdotorgRecordsets.py | Krenair/wmcs-misc-scripts | ae91b5756d73a9405634df9d6c32e98f21b97d5f | [
"Apache-2.0"
] | null | null | null | listWmflabsdotorgRecordsets.py | Krenair/wmcs-misc-scripts | ae91b5756d73a9405634df9d6c32e98f21b97d5f | [
"Apache-2.0"
] | null | null | null | import yaml
from keystoneclient.session import Session as KeystoneSession
from keystoneclient.auth.identity.v3 import Password as KeystonePassword
from keystoneclient.v3 import Client as KeystoneClient
from designateclient.v2 import client as designateclient
def get_keystone_session(project):
return KeystoneSessi... | 43.73913 | 144 | 0.717694 | import yaml
from keystoneclient.session import Session as KeystoneSession
from keystoneclient.auth.identity.v3 import Password as KeystonePassword
from keystoneclient.v3 import Client as KeystoneClient
from designateclient.v2 import client as designateclient
def get_keystone_session(project):
return KeystoneSessi... | true | true |
f71d5e89c15f2a96ab7cbc7f7360399c1dc32ae8 | 895 | py | Python | run_models.py | rustygentile/hornet-model | d6c7dce26de241a17fd7534b0e98b6a0112bf67f | [
"MIT"
] | null | null | null | run_models.py | rustygentile/hornet-model | d6c7dce26de241a17fd7534b0e98b6a0112bf67f | [
"MIT"
] | null | null | null | run_models.py | rustygentile/hornet-model | d6c7dce26de241a17fd7534b0e98b6a0112bf67f | [
"MIT"
] | 1 | 2022-01-19T09:28:18.000Z | 2022-01-19T09:28:18.000Z | import logging
from src.prep_data import main as prep_data
from src.run_sims import run_aggressive_sim, run_conservative_sim
from src.regression import make_and_run_model as run_model
from src.coupled import make_and_run_model as run_coupled
__author__ = 'Rusty Gentile'
logger = logging.getLogger(__name__)
... | 28.870968 | 69 | 0.694972 | import logging
from src.prep_data import main as prep_data
from src.run_sims import run_aggressive_sim, run_conservative_sim
from src.regression import make_and_run_model as run_model
from src.coupled import make_and_run_model as run_coupled
__author__ = 'Rusty Gentile'
logger = logging.getLogger(__name__)
... | true | true |
f71d61aa74de71397274ca14541acb7ad4c127e6 | 4,177 | py | Python | scraper/scraper.py | SebChw/IsMusicANaturalLanguage | 9cb245f9bea6c0f93863920fceeea867efa73ded | [
"MIT"
] | null | null | null | scraper/scraper.py | SebChw/IsMusicANaturalLanguage | 9cb245f9bea6c0f93863920fceeea867efa73ded | [
"MIT"
] | null | null | null | scraper/scraper.py | SebChw/IsMusicANaturalLanguage | 9cb245f9bea6c0f93863920fceeea867efa73ded | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup
import requests
from selenium import webdriver
from selenium.webdriver.common.by import By
import os
#! the very same functions are in scraper_artist.py. I just didn't want to make any dependencies with such simple scripts
def find_sublinks(artist_link):
"""Some artists have that ma... | 32.632813 | 145 | 0.681111 | from bs4 import BeautifulSoup
import requests
from selenium import webdriver
from selenium.webdriver.common.by import By
import os
def find_sublinks(artist_link):
links = [artist_link]
URL = f"https://freemidi.org/{artist_link}" # as it's written it works only for freemidi page
artist_page = requests.g... | true | true |
f71d63616367a7865c7b5676a10efc4ac37adc93 | 1,877 | py | Python | modules/readers/vtkStructPtsRDR.py | chrisidefix/devide | 99bfe156e710fa47ba7ae88b0ce1eef592a3a439 | [
"BSD-3-Clause"
] | 25 | 2015-08-24T16:05:14.000Z | 2020-12-09T20:07:14.000Z | modules/readers/vtkStructPtsRDR.py | chrisidefix/devide | 99bfe156e710fa47ba7ae88b0ce1eef592a3a439 | [
"BSD-3-Clause"
] | 1 | 2016-02-16T21:18:10.000Z | 2016-02-16T21:18:10.000Z | modules/readers/vtkStructPtsRDR.py | chrisidefix/devide | 99bfe156e710fa47ba7ae88b0ce1eef592a3a439 | [
"BSD-3-Clause"
] | 5 | 2016-02-16T20:05:37.000Z | 2020-01-31T11:27:39.000Z | # $Id$
from module_base import ModuleBase
from module_mixins import FilenameViewModuleMixin
import module_utils
import vtk
class vtkStructPtsRDR(FilenameViewModuleMixin, ModuleBase):
def __init__(self, module_manager):
# call parent constructor
ModuleBase.__init__(self, module_manager)
... | 26.814286 | 60 | 0.640384 |
from module_base import ModuleBase
from module_mixins import FilenameViewModuleMixin
import module_utils
import vtk
class vtkStructPtsRDR(FilenameViewModuleMixin, ModuleBase):
def __init__(self, module_manager):
ModuleBase.__init__(self, module_manager)
self._reader = vtk.vtkStructure... | true | true |
f71d63cc7c9ddb1abda047591af6a10facfba083 | 1,119 | py | Python | Web/Python/paraview/web/camera.py | qiangwushuang/ParaView | f35ed90a6582e9d21924b66a905498f6a38ab4a3 | [
"Apache-2.0",
"BSD-3-Clause"
] | 2 | 2021-07-07T22:53:19.000Z | 2021-07-31T19:29:35.000Z | Web/Python/paraview/web/camera.py | qiangwushuang/ParaView | f35ed90a6582e9d21924b66a905498f6a38ab4a3 | [
"Apache-2.0",
"BSD-3-Clause"
] | 2 | 2020-11-18T16:50:34.000Z | 2022-01-21T13:31:47.000Z | Web/Python/paraview/web/camera.py | qiangwushuang/ParaView | f35ed90a6582e9d21924b66a905498f6a38ab4a3 | [
"Apache-2.0",
"BSD-3-Clause"
] | 5 | 2020-10-02T10:14:35.000Z | 2022-03-10T07:50:22.000Z | from paraview import simple
from vtk.web import camera
def update_camera(viewProxy, cameraData):
viewProxy.CameraFocalPoint = cameraData['focalPoint']
viewProxy.CameraPosition = cameraData['position']
viewProxy.CameraViewUp = cameraData['viewUp']
simple.Render(viewProxy)
def create_spherical_camera(v... | 53.285714 | 156 | 0.822163 | from paraview import simple
from vtk.web import camera
def update_camera(viewProxy, cameraData):
viewProxy.CameraFocalPoint = cameraData['focalPoint']
viewProxy.CameraPosition = cameraData['position']
viewProxy.CameraViewUp = cameraData['viewUp']
simple.Render(viewProxy)
def create_spherical_camera(v... | true | true |
f71d6480f5768061a17266b485d534816caa4c41 | 3,535 | py | Python | callbacks.py | WHATDOESTHEFOXSAY2U/Colab_Train | 393269fe0fdf6c175926f485e7dfaf653a3686f3 | [
"Apache-2.0"
] | 8 | 2017-09-17T03:20:20.000Z | 2020-10-16T03:07:39.000Z | callbacks.py | navtosh-das/automatic-essay-grader-master | 30fdf2f9f72fbef51447ecc91070189ccca301b2 | [
"Apache-2.0"
] | 4 | 2020-02-26T00:16:29.000Z | 2022-02-26T05:19:48.000Z | callbacks.py | navtosh-das/automatic-essay-grader-master | 30fdf2f9f72fbef51447ecc91070189ccca301b2 | [
"Apache-2.0"
] | 4 | 2017-08-31T20:05:44.000Z | 2018-10-21T20:09:43.000Z | """
Contains custom callbacks.
"""
from constants import minimum_scores, maximum_scores
import constants
import datetime
import json
from keras.callbacks import Callback, ModelCheckpoint
import numpy as np
import os
from sklearn.metrics import cohen_kappa_score
from util import process_data, create_folder
class QWKSc... | 40.632184 | 193 | 0.648656 |
from constants import minimum_scores, maximum_scores
import constants
import datetime
import json
from keras.callbacks import Callback, ModelCheckpoint
import numpy as np
import os
from sklearn.metrics import cohen_kappa_score
from util import process_data, create_folder
class QWKScore(Callback):
def __init__(sel... | true | true |
f71d64ae1faeafbcfe3e3258855aea0147730782 | 87 | py | Python | fandogh_cli/__init__.py | behroozmirzaie7/fandogh-cli | e23d5c761a85b539b1c5f80bd9c6fd7bd2e5f9f0 | [
"MIT"
] | 131 | 2018-05-14T21:00:40.000Z | 2022-03-29T10:00:54.000Z | fandogh_cli/__init__.py | behroozmirzaie7/fandogh-cli | e23d5c761a85b539b1c5f80bd9c6fd7bd2e5f9f0 | [
"MIT"
] | 130 | 2018-05-14T19:43:18.000Z | 2021-08-28T08:52:04.000Z | fandogh_cli/__init__.py | behroozmirzaie7/fandogh-cli | e23d5c761a85b539b1c5f80bd9c6fd7bd2e5f9f0 | [
"MIT"
] | 37 | 2018-05-15T05:59:56.000Z | 2022-03-08T05:26:54.000Z | VERSION = "1.21.3"
NAME = "fandogh_cli"
if __name__ == "__main__":
print(VERSION)
| 14.5 | 26 | 0.643678 | VERSION = "1.21.3"
NAME = "fandogh_cli"
if __name__ == "__main__":
print(VERSION)
| true | true |
f71d650791f7f46ff04b43e0175f98b5c704dac5 | 7,390 | py | Python | main.py | hujunxianligong/Graph-U-Nets | d1a483400131fbe75a55cff27439585c62c4a575 | [
"MIT"
] | 1 | 2021-01-03T09:23:41.000Z | 2021-01-03T09:23:41.000Z | main.py | hujunxianligong/Graph-U-Nets | d1a483400131fbe75a55cff27439585c62c4a575 | [
"MIT"
] | null | null | null | main.py | hujunxianligong/Graph-U-Nets | d1a483400131fbe75a55cff27439585c62c4a575 | [
"MIT"
] | null | null | null | import sys
import os
import torch
import random
import numpy as np
from tqdm import tqdm
import torch.nn as nn
import torch.optim as optim
import math
from network import GUNet
from mlp_dropout import MLPClassifier
from sklearn import metrics
from util import cmd_args, load_data
sys.path.append(
'%s/pytorch_struc... | 35.023697 | 145 | 0.625304 | import sys
import os
import torch
import random
import numpy as np
from tqdm import tqdm
import torch.nn as nn
import torch.optim as optim
import math
from network import GUNet
from mlp_dropout import MLPClassifier
from sklearn import metrics
from util import cmd_args, load_data
sys.path.append(
'%s/pytorch_struc... | true | true |
f71d65ca0d14c5df4be828df9a38fc4cf62124f4 | 1,636 | py | Python | python_developer_tools/cv/classes/ResNeXt.py | carlsummer/python_developer_tools | a8c4365b7cc601cda55648cdfd8c0cb1faae132f | [
"Apache-2.0"
] | 32 | 2021-06-21T04:49:48.000Z | 2022-03-29T05:46:59.000Z | python_developer_tools/cv/classes/ResNeXt.py | HonestyBrave/python_developer_tools | fc0dcf5c4ef088e2e535206dc82f09bbfd01f280 | [
"Apache-2.0"
] | 1 | 2021-11-12T03:45:55.000Z | 2021-11-12T03:45:55.000Z | python_developer_tools/cv/classes/ResNeXt.py | HonestyBrave/python_developer_tools | fc0dcf5c4ef088e2e535206dc82f09bbfd01f280 | [
"Apache-2.0"
] | 10 | 2021-06-03T08:05:05.000Z | 2021-12-13T03:10:42.000Z | import torch
import torch.nn as nn
import torchvision
class ResNeXtBlock(nn.Module):
def __init__(self,in_places,places, stride=1,downsampling=False, expansion = 2, cardinality=32):
super(ResNeXtBlock,self).__init__()
self.expansion = expansion
self.downsampling = downsampling
sel... | 34.083333 | 136 | 0.635697 | import torch
import torch.nn as nn
import torchvision
class ResNeXtBlock(nn.Module):
def __init__(self,in_places,places, stride=1,downsampling=False, expansion = 2, cardinality=32):
super(ResNeXtBlock,self).__init__()
self.expansion = expansion
self.downsampling = downsampling
sel... | true | true |
f71d65e945a2a090fa91fb86ee8b0f75888af76e | 20,918 | py | Python | kedro/io/core.py | jonasrk/kedro | 9fd2abd112c0118b7a001aba7f11fa287d10db18 | [
"Apache-2.0"
] | 1 | 2020-12-30T01:44:36.000Z | 2020-12-30T01:44:36.000Z | kedro/io/core.py | jonasrk/kedro | 9fd2abd112c0118b7a001aba7f11fa287d10db18 | [
"Apache-2.0"
] | null | null | null | kedro/io/core.py | jonasrk/kedro | 9fd2abd112c0118b7a001aba7f11fa287d10db18 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-2019 QuantumBlack Visual Analytics Limited
#
# 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
#
# THE SOFTWARE IS PROVIDED "AS IS"... | 35.156303 | 96 | 0.612821 |
import abc
import copy
import logging
import os
from collections import namedtuple
from datetime import datetime, timezone
from glob import iglob
from pathlib import Path, PurePath
from typing import Any, Callable, Dict, List, Optional, Tuple, Type
from urllib.parse import urlparse
from war... | true | true |
f71d664600932b67be3bc734c66fe4ff4b43a8de | 17,171 | py | Python | engine/SCons/Tool/rpmutils.py | cctbx/scons | 9eb46f7e2a965e1041e5b1a6bc941c1e97bceb00 | [
"MIT"
] | 1 | 2020-05-28T17:50:54.000Z | 2020-05-28T17:50:54.000Z | engine/SCons/Tool/rpmutils.py | cctbx/scons | 9eb46f7e2a965e1041e5b1a6bc941c1e97bceb00 | [
"MIT"
] | 4 | 2018-07-24T05:46:04.000Z | 2018-08-07T06:10:45.000Z | engine/SCons/Tool/rpmutils.py | cctbx/scons | 9eb46f7e2a965e1041e5b1a6bc941c1e97bceb00 | [
"MIT"
] | 1 | 2018-07-23T10:34:27.000Z | 2018-07-23T10:34:27.000Z | """SCons.Tool.rpmutils.py
RPM specific helper routines for general usage in the test framework
and SCons core modules.
Since we check for the RPM package target name in several places,
we have to know which machine/system name RPM will use for the current
hardware setup. The following dictionaries and functions try t... | 31.333942 | 107 | 0.524314 |
from __future__ import print_function
__revision__ = "src/engine/SCons/Tool/rpmutils.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
import platform
import subprocess
import SCons.Util
os_canon = {
'AIX' : ['AIX','5'],
'AmigaOS' : ['AmigaOS','5'],
'BSD_OS' : ['bsdi','12'],
... | true | true |
f71d672bcf533ac2ac8ebfb1e4f4f25cd9aa808f | 4,105 | py | Python | mesos_operations/mesos_operations.py | sasank1/plugins | f12dcb207dcd53819f2f23eeaab3b60a40885d4b | [
"BSD-2-Clause"
] | 36 | 2016-03-30T10:59:37.000Z | 2022-02-28T21:46:42.000Z | mesos_operations/mesos_operations.py | sasank1/plugins | f12dcb207dcd53819f2f23eeaab3b60a40885d4b | [
"BSD-2-Clause"
] | 21 | 2016-10-07T06:20:56.000Z | 2022-03-10T12:09:34.000Z | mesos_operations/mesos_operations.py | sasank1/plugins | f12dcb207dcd53819f2f23eeaab3b60a40885d4b | [
"BSD-2-Clause"
] | 65 | 2016-03-16T09:11:48.000Z | 2022-03-09T13:10:08.000Z | #!/usr/bin/python
import json
import urllib2
### For monitoring the performance metrics of your Mesos Agents using Site24x7 Server Monitoring Plugins.
### 1. Have the site24x7 server monitoring agent up and running.
### 2. Download the plugin from github
### 3. Create a folder in name of the plugin under agent plugi... | 42.760417 | 216 | 0.649939 |
import json
import urllib2
msg'] = str(e)
self.status = 0
return self.data
def parseClusterData(self, output):
try:
data = json.loads(output.decode('UTF-8'))
self.data['master_slave_registrations'] = data['master/slave_registrations']
... | true | true |
f71d6913191f30ac3e407165484554354a24b22d | 1,734 | py | Python | muddery/server/upgrader/base_upgrader.py | MarsZone/DreamLand | 87455f421c1ba09cb6efd5fc0882fbc2a29ea1a5 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | muddery/server/upgrader/base_upgrader.py | MarsZone/DreamLand | 87455f421c1ba09cb6efd5fc0882fbc2a29ea1a5 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | muddery/server/upgrader/base_upgrader.py | MarsZone/DreamLand | 87455f421c1ba09cb6efd5fc0882fbc2a29ea1a5 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | """
Upgrade custom's game dir to the latest version.
"""
from utils import compare_version
class BaseUpgrader(object):
"""
Upgrade a game dir from the version in [<from_version>, <to_version>) to version
<target_version>.
"""
# Can upgrade the game of version between from_version and to_version.
... | 29.896552 | 84 | 0.619954 |
from utils import compare_version
class BaseUpgrader(object):
from_min_version = (0, 0, 0)
from_max_version = (0, 0, 0)
target_version = None
def upgrade_game(self, game_dir, game_template, muddery_lib):
pass
def upgrade_data(self, data_path, game_template,... | true | true |
f71d69f1c9f19da80953622dfdb60cfd07448bed | 17,664 | py | Python | saticl/training.py | edornd/multimodal-icl | f79bfa73665db471c12ee9cb57bbee1bcabb0467 | [
"MIT"
] | 6 | 2021-12-08T05:58:18.000Z | 2021-12-29T09:55:32.000Z | saticl/training.py | edornd/multimodal-icl | f79bfa73665db471c12ee9cb57bbee1bcabb0467 | [
"MIT"
] | null | null | null | saticl/training.py | edornd/multimodal-icl | f79bfa73665db471c12ee9cb57bbee1bcabb0467 | [
"MIT"
] | null | null | null | from itertools import chain
from pathlib import Path
from typing import Tuple
import torch
from accelerate import Accelerator
from torch.utils.data import DataLoader
from saticl.config import Configuration, SSLConfiguration
from saticl.datasets.icl import ICLDataset
from saticl.datasets.transforms import invariance_t... | 50.613181 | 121 | 0.637908 | from itertools import chain
from pathlib import Path
from typing import Tuple
import torch
from accelerate import Accelerator
from torch.utils.data import DataLoader
from saticl.config import Configuration, SSLConfiguration
from saticl.datasets.icl import ICLDataset
from saticl.datasets.transforms import invariance_t... | true | true |
f71d6afb0bb38164f69476aebefe7d64806e5c99 | 484 | py | Python | src/scrapper/scrappers/webSiteScrappers/leadersScrapper.py | media-watch/mediascrapper | 43e35eb4ae8011ff83cabb2d6c95e26a673aba27 | [
"BSD-2-Clause"
] | null | null | null | src/scrapper/scrappers/webSiteScrappers/leadersScrapper.py | media-watch/mediascrapper | 43e35eb4ae8011ff83cabb2d6c95e26a673aba27 | [
"BSD-2-Clause"
] | 4 | 2021-07-14T22:25:00.000Z | 2021-07-14T22:40:00.000Z | src/scrapper/scrappers/webSiteScrappers/leadersScrapper.py | media-watch/mediascrapper | 43e35eb4ae8011ff83cabb2d6c95e26a673aba27 | [
"BSD-2-Clause"
] | null | null | null | from bs4 import BeautifulSoup
class LeadersScrapper:
def scrap(self, html):
soup = BeautifulSoup(html, features="html.parser")
title = soup.find("h1").text
date = soup.find("div",{"class":"infos"}).text
data = [ arti.text for arti in soup.find("div", {"class":"article_body"}).f... | 37.230769 | 97 | 0.592975 | from bs4 import BeautifulSoup
class LeadersScrapper:
def scrap(self, html):
soup = BeautifulSoup(html, features="html.parser")
title = soup.find("h1").text
date = soup.find("div",{"class":"infos"}).text
data = [ arti.text for arti in soup.find("div", {"class":"article_body"}).f... | true | true |
f71d6b8d8c08175c683fa96aa4f11e6b6b31103d | 705 | py | Python | contact/migrations/0002_auto_20200914_2108.py | SandyAbdullahi/francis_cms | 55b64d91fcbc1d6b4dd853aff7294dedd417e0ab | [
"MIT"
] | null | null | null | contact/migrations/0002_auto_20200914_2108.py | SandyAbdullahi/francis_cms | 55b64d91fcbc1d6b4dd853aff7294dedd417e0ab | [
"MIT"
] | null | null | null | contact/migrations/0002_auto_20200914_2108.py | SandyAbdullahi/francis_cms | 55b64d91fcbc1d6b4dd853aff7294dedd417e0ab | [
"MIT"
] | null | null | null | # Generated by Django 3.1.1 on 2020-09-14 18:08
from django.db import migrations
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
('contact', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='contactpage',
nam... | 24.310345 | 64 | 0.585816 |
from django.db import migrations
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
('contact', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='contactpage',
name='body',
),
migrations.AddFiel... | true | true |
f71d6cbd63ff5c532cd6188976d551d9a5e087ea | 2,743 | py | Python | src/slider_experiment/slider_experiment/thruster_pwm_tsl.py | frank20a/collaborative-sats | 9d26d3c8f66cf43bbd514f02434851439e746797 | [
"MIT"
] | null | null | null | src/slider_experiment/slider_experiment/thruster_pwm_tsl.py | frank20a/collaborative-sats | 9d26d3c8f66cf43bbd514f02434851439e746797 | [
"MIT"
] | 6 | 2022-03-22T18:54:38.000Z | 2022-03-31T16:42:37.000Z | src/slider_experiment/slider_experiment/thruster_pwm_tsl.py | frank20a/collaborative-sats | 9d26d3c8f66cf43bbd514f02434851439e746797 | [
"MIT"
] | null | null | null | import rclpy
from rclpy.node import Node
from geometry_msgs.msg import Vector3
from std_msgs.msg import Int16
from rclpy.qos import QoSPresetProfiles
from ament_index_python import get_package_share_directory
import numpy as np
import sys, os
from .parameters import force
from .flags import flags
def create_pwm(val... | 31.895349 | 145 | 0.62778 | import rclpy
from rclpy.node import Node
from geometry_msgs.msg import Vector3
from std_msgs.msg import Int16
from rclpy.qos import QoSPresetProfiles
from ament_index_python import get_package_share_directory
import numpy as np
import sys, os
from .parameters import force
from .flags import flags
def create_pwm(val... | true | true |
f71d6cf373223c59a20c6cb59a39218776e382a0 | 2,697 | py | Python | flink-python/pyflink/table/tests/test_environment_completeness.py | sekikn/flink | 405cf8f429c6a5031c21597abe9193bedcb8e15b | [
"Apache-2.0"
] | 4 | 2020-05-28T03:36:05.000Z | 2022-02-22T13:46:05.000Z | flink-python/pyflink/table/tests/test_environment_completeness.py | sekikn/flink | 405cf8f429c6a5031c21597abe9193bedcb8e15b | [
"Apache-2.0"
] | 5 | 2021-03-30T04:48:08.000Z | 2021-12-24T08:22:11.000Z | flink-python/pyflink/table/tests/test_environment_completeness.py | sekikn/flink | 405cf8f429c6a5031c21597abe9193bedcb8e15b | [
"Apache-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... | 35.96 | 89 | 0.656285 | true | true | |
f71d6e590e9719f5ddc95217fd64f92e9bd77eaa | 375 | py | Python | recover-commits.py | pendashteh/git-recover-index | 2dba70959a463879a34a072a30fba839e974d8e8 | [
"MIT"
] | 39 | 2016-03-17T18:36:08.000Z | 2021-06-18T18:15:30.000Z | recover-commits.py | pendashteh/git-recover-index | 2dba70959a463879a34a072a30fba839e974d8e8 | [
"MIT"
] | 1 | 2019-01-06T22:10:18.000Z | 2019-01-06T22:10:18.000Z | recover-commits.py | pendashteh/git-recover-index | 2dba70959a463879a34a072a30fba839e974d8e8 | [
"MIT"
] | 6 | 2016-05-06T14:00:20.000Z | 2019-09-04T16:04:26.000Z | import os
commits_file = os.environ['_git_recover_index_tmpfile']
commits_recover_path = os.environ['_git_recover_index_recover_path']
commits = [line.rstrip('\n') for line in open(commits_file)]
from subprocess import call
filename = commits_recover_path + "/file-"
i = 1
for c in commits:
f = open(filename + str(i... | 31.25 | 68 | 0.717333 | import os
commits_file = os.environ['_git_recover_index_tmpfile']
commits_recover_path = os.environ['_git_recover_index_recover_path']
commits = [line.rstrip('\n') for line in open(commits_file)]
from subprocess import call
filename = commits_recover_path + "/file-"
i = 1
for c in commits:
f = open(filename + str(i... | true | true |
f71d6e6997ab22122d04476adc125c2e2dca54b2 | 374 | py | Python | code/day09/demo04.py | picktsh/python | 0f758dcdf9eee3580d8f6e2241ef557b6320ef54 | [
"MIT"
] | 1 | 2019-12-31T16:44:06.000Z | 2019-12-31T16:44:06.000Z | code/day09/demo04.py | picktsh/python | 0f758dcdf9eee3580d8f6e2241ef557b6320ef54 | [
"MIT"
] | null | null | null | code/day09/demo04.py | picktsh/python | 0f758dcdf9eee3580d8f6e2241ef557b6320ef54 | [
"MIT"
] | 1 | 2022-01-13T10:32:22.000Z | 2022-01-13T10:32:22.000Z | ### 多个函数间的配合
## 变量的作用域
rent = 3000
variable_cost = 0
def cost():
global variable_cost # 使用全局的变量
utilities = int(input('请输入本月的水电费用'))
food_cost = int(input('请输入本月的食材费用'))
variable_cost = utilities + food_cost
print('本月的变动成本费用是' + str(variable_cost))
def sum_cost():
sum = rent + variable_cos... | 16.26087 | 44 | 0.657754 | = 0
def cost():
global variable_cost
utilities = int(input('请输入本月的水电费用'))
food_cost = int(input('请输入本月的食材费用'))
variable_cost = utilities + food_cost
print('本月的变动成本费用是' + str(variable_cost))
def sum_cost():
sum = rent + variable_cost
print('本月的总成本是' + str(sum))
cost()
sum_cost()
| true | true |
f71d6eddc110a6ecb2c6c457700d79c73a0ae05f | 404 | py | Python | python/kata/6-kyu/Corner Fill/solution.py | Carlososuna11/codewars-handbook | a0e7c9ac5ad19cfaed3ad463c04616daa3fed82e | [
"MIT"
] | null | null | null | python/kata/6-kyu/Corner Fill/solution.py | Carlososuna11/codewars-handbook | a0e7c9ac5ad19cfaed3ad463c04616daa3fed82e | [
"MIT"
] | null | null | null | python/kata/6-kyu/Corner Fill/solution.py | Carlososuna11/codewars-handbook | a0e7c9ac5ad19cfaed3ad463c04616daa3fed82e | [
"MIT"
] | null | null | null | def corner_fill(square):
removeStarting = lambda x: [y[:-1] for y in x[1:]]
corner = lambda x: x[0]+[y[-1] for y in x[1:]]
result =[]
n = len(square)
if n == 0: return []
for i in range(n):
if i % 2 ==0:
result = result + corner(square)
else:
result = res... | 31.076923 | 55 | 0.519802 | def corner_fill(square):
removeStarting = lambda x: [y[:-1] for y in x[1:]]
corner = lambda x: x[0]+[y[-1] for y in x[1:]]
result =[]
n = len(square)
if n == 0: return []
for i in range(n):
if i % 2 ==0:
result = result + corner(square)
else:
result = res... | true | true |
f71d6f2d262c160937a5abfacbcec8080a0ea116 | 228 | py | Python | algorithms/tree_diameter.py | nazaruka/Catan-AI | d7c91c7011ac82ad41d3b80a29c73c23ab7b579e | [
"MIT"
] | 9 | 2019-07-16T15:28:00.000Z | 2022-02-08T00:53:39.000Z | algorithms/tree_diameter.py | nazaruka/Catan-AI | d7c91c7011ac82ad41d3b80a29c73c23ab7b579e | [
"MIT"
] | 2 | 2020-01-09T15:27:58.000Z | 2020-09-23T18:04:41.000Z | algorithms/tree_diameter.py | nazaruka/Catan-AI | d7c91c7011ac82ad41d3b80a29c73c23ab7b579e | [
"MIT"
] | 5 | 2019-08-07T16:51:38.000Z | 2021-05-06T04:01:32.000Z | import networkx
from algorithms.dfs import dfs
def tree_diameter(t: networkx.Graph):
if __debug__:
assert networkx.is_tree(t)
v, _ = dfs(t)
_, longest_path_length = dfs(t, v)
return longest_path_length
| 20.727273 | 38 | 0.697368 | import networkx
from algorithms.dfs import dfs
def tree_diameter(t: networkx.Graph):
if __debug__:
assert networkx.is_tree(t)
v, _ = dfs(t)
_, longest_path_length = dfs(t, v)
return longest_path_length
| true | true |
f71d6fc4eaee727eeda655eda3c7d6e9b60c45e6 | 4,713 | py | Python | app.py | lucaskolson/ddd | f273c61856bca27a40b9691b2a9842d8705a3503 | [
"MIT"
] | null | null | null | app.py | lucaskolson/ddd | f273c61856bca27a40b9691b2a9842d8705a3503 | [
"MIT"
] | null | null | null | app.py | lucaskolson/ddd | f273c61856bca27a40b9691b2a9842d8705a3503 | [
"MIT"
] | null | null | null | import dash
from dash import dcc
from dash import html
from dash.dependencies import Input, Output
import plotly.express as px
import pandas as pd
from dash import callback_context
df = px.data.election()
geojson = px.data.election_geojson()
candidates = df.winner.unique()
external_stylesheets = ['https://codepen.io/... | 32.503448 | 187 | 0.51708 | import dash
from dash import dcc
from dash import html
from dash.dependencies import Input, Output
import plotly.express as px
import pandas as pd
from dash import callback_context
df = px.data.election()
geojson = px.data.election_geojson()
candidates = df.winner.unique()
external_stylesheets = ['https://codepen.io/... | true | true |
f71d6ffb1dd30874cf880bc17a48e08b5e247ed7 | 1,072 | py | Python | migrations/versions/3aa95a42561c_this_is_a_migration.py | rice0208/Flog | d56be0b814a0c6ca1fe4abd2c764552121698a94 | [
"MIT"
] | 14 | 2020-09-20T01:23:01.000Z | 2022-02-09T09:11:10.000Z | migrations/versions/3aa95a42561c_this_is_a_migration.py | rice0208/Flog | d56be0b814a0c6ca1fe4abd2c764552121698a94 | [
"MIT"
] | 15 | 2020-12-23T13:19:46.000Z | 2022-01-22T08:38:22.000Z | migrations/versions/3aa95a42561c_this_is_a_migration.py | rice0208/Flog | d56be0b814a0c6ca1fe4abd2c764552121698a94 | [
"MIT"
] | 4 | 2021-03-14T01:49:30.000Z | 2021-11-25T08:31:55.000Z | """this is a migration
Revision ID: 3aa95a42561c
Revises: 98fef64846fe
Create Date: 2021-10-04 10:49:46.832296
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "3aa95a42561c"
down_revision = "98fef64846fe"
branch_labels = None
depends_on = None
def upgrade():
... | 27.487179 | 78 | 0.698694 | from alembic import op
import sqlalchemy as sa
revision = "3aa95a42561c"
down_revision = "98fef64846fe"
branch_labels = None
depends_on = None
def upgrade():
r", schema=None) as batch_op:
batch_op.add_column(sa.Column("avatar_style", sa.String(length=1024)))
| true | true |
f71d703c6b01e0801154484a75bebd175b111b06 | 699 | py | Python | e3nn/__init__.py | claycurry34/e3nn | 3cfbf679d10781a01d9c83b04a2e7d79d4914c23 | [
"MIT"
] | null | null | null | e3nn/__init__.py | claycurry34/e3nn | 3cfbf679d10781a01d9c83b04a2e7d79d4914c23 | [
"MIT"
] | null | null | null | e3nn/__init__.py | claycurry34/e3nn | 3cfbf679d10781a01d9c83b04a2e7d79d4914c23 | [
"MIT"
] | null | null | null | __version__ = "0.4.4"
from typing import Dict
_OPT_DEFAULTS: Dict[str, bool] = dict(
specialized_code=True,
optimize_einsums=True,
jit_script_fx=True,
)
def set_optimization_defaults(**kwargs) -> None:
r"""Globally set the default optimization settings.
Parameters
----------
**kwargs
... | 23.3 | 67 | 0.663805 | __version__ = "0.4.4"
from typing import Dict
_OPT_DEFAULTS: Dict[str, bool] = dict(
specialized_code=True,
optimize_einsums=True,
jit_script_fx=True,
)
def set_optimization_defaults(**kwargs) -> None:
for k, v in kwargs.items():
if k not in _OPT_DEFAULTS:
raise ValueError(f"Unk... | true | true |
f71d71cddd85fa3d98cd38c34ab0b09669a18685 | 752 | py | Python | notes-n-resources/Data-Structures-N-Algo/_DS-n-Algos/_Another-One/Project Euler/Problem 40/sol1.py | side-projects-42/INTERVIEW-PREP-COMPLETE | 627a3315cee4bbc38a0e81c256f27f928eac2d63 | [
"MIT"
] | 13 | 2021-03-11T00:25:22.000Z | 2022-03-19T00:19:23.000Z | notes-n-resources/Data-Structures-N-Algo/_DS-n-Algos/_Another-One/Project Euler/Problem 40/sol1.py | side-projects-42/INTERVIEW-PREP-COMPLETE | 627a3315cee4bbc38a0e81c256f27f928eac2d63 | [
"MIT"
] | 160 | 2021-04-26T19:04:15.000Z | 2022-03-26T20:18:37.000Z | notes-n-resources/Data-Structures-N-Algo/_DS-n-Algos/_Another-One/Project Euler/Problem 40/sol1.py | side-projects-42/INTERVIEW-PREP-COMPLETE | 627a3315cee4bbc38a0e81c256f27f928eac2d63 | [
"MIT"
] | 12 | 2021-04-26T19:43:01.000Z | 2022-01-31T08:36:29.000Z | # -.- coding: latin-1 -.-
from __future__ import print_function
"""
Champernowne's constant
Problem 40
An irrational decimal fraction is created by concatenating the positive integers:
0.123456789101112131415161718192021...
It can be seen that the 12th digit of the fractional part is 1.
If dn represents the nth dig... | 20.888889 | 98 | 0.6875 |
from __future__ import print_function
constant = []
i = 1
while len(constant) < 1e6:
constant.append(str(i))
i += 1
constant = "".join(constant)
print(
int(constant[0])
* int(constant[9])
* int(constant[99])
* int(constant[999])
* int(constant[9999])
* int(constant[99999])
* in... | true | true |
f71d71fe37a1f2f44e56d006e3c304850b855a98 | 2,553 | py | Python | src/books.py | LucasAntognoni/book-bot | 625632b8115654921caa3961153412c129961164 | [
"MIT"
] | 3 | 2019-07-09T19:56:15.000Z | 2020-02-19T23:26:00.000Z | src/books.py | LucasAntognoni/book-bot | 625632b8115654921caa3961153412c129961164 | [
"MIT"
] | null | null | null | src/books.py | LucasAntognoni/book-bot | 625632b8115654921caa3961153412c129961164 | [
"MIT"
] | null | null | null | import requests
class Books(object):
BASE_URL = \
'https://www.googleapis.com/books/v1/volumes?' \
'q="{}"&projection={}&printType={}&langRestrict={}&maxResults={}'
MAX_RESULTS = 1
PRINT_TYPE = 'books'
PROJECTION = 'full'
LANGUAGE = 'en'
# SEARCH_FIELDS = {
# "title":... | 25.277228 | 87 | 0.461418 | import requests
class Books(object):
BASE_URL = \
'https://www.googleapis.com/books/v1/volumes?' \
'q="{}"&projection={}&printType={}&langRestrict={}&maxResults={}'
MAX_RESULTS = 1
PRINT_TYPE = 'books'
PROJECTION = 'full'
LANGUAGE = 'en'
BO... | true | true |
f71d72c5ef13e3198b890b424d27e5e967a73e65 | 6,945 | py | Python | qiskit/visualization/timeline/plotters/matplotlib.py | Roshan-Thomas/qiskit-terra | 77219b5c7b7146b1545c5e5190739b36f4064b2f | [
"Apache-2.0"
] | 1,456 | 2017-08-05T16:33:05.000Z | 2018-06-05T04:15:35.000Z | qiskit/visualization/timeline/plotters/matplotlib.py | Roshan-Thomas/qiskit-terra | 77219b5c7b7146b1545c5e5190739b36f4064b2f | [
"Apache-2.0"
] | 365 | 2017-08-04T06:09:16.000Z | 2018-06-05T08:33:37.000Z | qiskit/visualization/timeline/plotters/matplotlib.py | Roshan-Thomas/qiskit-terra | 77219b5c7b7146b1545c5e5190739b36f4064b2f | [
"Apache-2.0"
] | 463 | 2017-08-05T04:10:01.000Z | 2018-06-05T06:43:21.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 35.798969 | 96 | 0.589201 |
from typing import Optional, Tuple
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.collections import PatchCollection
from matplotlib.patches import Rectangle
from qiskit.visualization.exceptions import VisualizationError
from qiskit.visualization.timeline import co... | true | true |
f71d72cda2b0734621a761af5136ca30a617de91 | 13,762 | py | Python | tests/ut/python/dataset/test_compose.py | limberc/mindspore | e294acdffc9246cb6d77ea18ea00d08244d30c59 | [
"Apache-2.0"
] | 1 | 2021-01-25T07:39:46.000Z | 2021-01-25T07:39:46.000Z | tests/ut/python/dataset/test_compose.py | forwhat461/mindspore | 59a277756eb4faad9ac9afcc7fd526e8277d4994 | [
"Apache-2.0"
] | null | null | null | tests/ut/python/dataset/test_compose.py | forwhat461/mindspore | 59a277756eb4faad9ac9afcc7fd526e8277d4994 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 40.476471 | 120 | 0.60994 |
import numpy as np
import pytest
import mindspore.common.dtype as mstype
import mindspore.dataset as ds
import mindspore.dataset.transforms.c_transforms as c_transforms
import mindspore.dataset.transforms.py_transforms as py_transforms
import mindspore.dataset.vision.c_transforms as c_vision
import mind... | true | true |
f71d732ef7336c113e6a500672479f9fa4c6e935 | 4,185 | py | Python | packnet_sfm/models/SemiSupModel_fisheye.py | vbelissen/packnet-sfm | dfba692596b08ccff17abb9423c1958cecc75b0f | [
"MIT"
] | null | null | null | packnet_sfm/models/SemiSupModel_fisheye.py | vbelissen/packnet-sfm | dfba692596b08ccff17abb9423c1958cecc75b0f | [
"MIT"
] | null | null | null | packnet_sfm/models/SemiSupModel_fisheye.py | vbelissen/packnet-sfm | dfba692596b08ccff17abb9423c1958cecc75b0f | [
"MIT"
] | null | null | null | # Copyright 2020 Toyota Research Institute. All rights reserved.
import torch
from packnet_sfm.models.SelfSupModel_fisheye import SfmModel, SelfSupModel_fisheye
from packnet_sfm.losses.supervised_loss_valeo import SupervisedLoss
from packnet_sfm.models.model_utils import merge_outputs
from packnet_sfm.utils.depth im... | 36.710526 | 87 | 0.615054 |
import torch
from packnet_sfm.models.SelfSupModel_fisheye import SfmModel, SelfSupModel_fisheye
from packnet_sfm.losses.supervised_loss_valeo import SupervisedLoss
from packnet_sfm.models.model_utils import merge_outputs
from packnet_sfm.utils.depth import depth2inv
class SemiSupModel_fisheye(SelfSupModel_fisheye)... | true | true |
f71d73d71ba339d6c7641179ef7f69755e76319e | 616 | py | Python | cythonTest/onlineSample/combination/jit_combination.py | terasakisatoshi/pythonCodes | baee095ecee96f6b5ec6431267cdc6c40512a542 | [
"MIT"
] | null | null | null | cythonTest/onlineSample/combination/jit_combination.py | terasakisatoshi/pythonCodes | baee095ecee96f6b5ec6431267cdc6c40512a542 | [
"MIT"
] | null | null | null | cythonTest/onlineSample/combination/jit_combination.py | terasakisatoshi/pythonCodes | baee095ecee96f6b5ec6431267cdc6c40512a542 | [
"MIT"
] | null | null | null | import time
from numba import jit
import numpy as np
@jit()
def jit_sum_conbination(N):
xs = [i for i in range(N)]
ys = [i for i in range(N)]
total = 0
for x in xs:
for y in ys:
total += x+y
return total
def py_sum_conbination(N):
xs = np.arange(N)
ys = np.arange(N)
... | 18.117647 | 37 | 0.553571 | import time
from numba import jit
import numpy as np
@jit()
def jit_sum_conbination(N):
xs = [i for i in range(N)]
ys = [i for i in range(N)]
total = 0
for x in xs:
for y in ys:
total += x+y
return total
def py_sum_conbination(N):
xs = np.arange(N)
ys = np.arange(N)
... | true | true |
f71d73df5330b5ef66e0e587f04a759ffd88b242 | 4,409 | py | Python | test/functional/p2p_zpos_fakestake_accepted.py | salo50/coin | 2c7cc3a4b4cb8931e14845a60eb6b051eae18a72 | [
"MIT"
] | null | null | null | test/functional/p2p_zpos_fakestake_accepted.py | salo50/coin | 2c7cc3a4b4cb8931e14845a60eb6b051eae18a72 | [
"MIT"
] | null | null | null | test/functional/p2p_zpos_fakestake_accepted.py | salo50/coin | 2c7cc3a4b4cb8931e14845a60eb6b051eae18a72 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2019 The redspace Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Performs the same check as in Test_02 verifying that zPoS forked blocks that stake a zerocoin which is sp... | 37.364407 | 189 | 0.621456 |
from test_framework.authproxy import JSONRPCException
from fake_stake.base_test import redspace_FakeStakeTest
from time import sleep
class zPoSFakeStakeAccepted(redspace_FakeStakeTest):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 1
self.extra_args = [['... | true | true |
f71d73fee6e604915153c8e6e7d293a6a713e8a7 | 11,201 | py | Python | docs/source/conf.py | colindonfack/statsmodels | a251e4cd4b689781916e1001d7e8ca2c0395ef1f | [
"BSD-3-Clause"
] | 15 | 2015-03-03T09:47:42.000Z | 2022-01-05T18:28:31.000Z | docs/source/conf.py | colindonfack/statsmodels | a251e4cd4b689781916e1001d7e8ca2c0395ef1f | [
"BSD-3-Clause"
] | 7 | 2015-11-20T08:33:04.000Z | 2020-07-24T19:34:39.000Z | docs/source/conf.py | colindonfack/statsmodels | a251e4cd4b689781916e1001d7e8ca2c0395ef1f | [
"BSD-3-Clause"
] | 14 | 2015-01-06T22:08:34.000Z | 2021-01-01T16:33:23.000Z | # -*- coding: utf-8 -*-
#
# statsmodels documentation build configuration file, created by
# sphinx-quickstart on Sat Jan 22 11:17:58 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
#... | 33.942424 | 103 | 0.70949 |
import sys, os
sys.path.insert(0, os.path.abspath('../sphinxext'))
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.mathjax',
'sphinx.ext.viewc... | true | true |
f71d74209b671ba4f44feb645fe56447c58e62e9 | 20,551 | py | Python | venv/lib/python3.9/site-packages/jupyter_client/tests/test_kernelmanager.py | CMU-IDS-2022/final-project-the-evaluators | 3b9262ad1a0f7315208a94a05ea1ce38e679d01d | [
"BSD-3-Clause"
] | null | null | null | venv/lib/python3.9/site-packages/jupyter_client/tests/test_kernelmanager.py | CMU-IDS-2022/final-project-the-evaluators | 3b9262ad1a0f7315208a94a05ea1ce38e679d01d | [
"BSD-3-Clause"
] | null | null | null | venv/lib/python3.9/site-packages/jupyter_client/tests/test_kernelmanager.py | CMU-IDS-2022/final-project-the-evaluators | 3b9262ad1a0f7315208a94a05ea1ce38e679d01d | [
"BSD-3-Clause"
] | null | null | null | """Tests for the KernelManager"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import asyncio
import concurrent.futures
import json
import os
import signal
import sys
import time
from subprocess import PIPE
import pytest
from jupyter_core import paths
from traitl... | 35.190068 | 100 | 0.634373 |
import asyncio
import concurrent.futures
import json
import os
import signal
import sys
import time
from subprocess import PIPE
import pytest
from jupyter_core import paths
from traitlets.config.loader import Config
from ..manager import _ShutdownStatus
from ..manager import start_new_async_kernel
from ..manager im... | true | true |
f71d75126854c13366d9024369f6b81a57870f3f | 4,707 | py | Python | modnotes/modnotes.py | chasehult/misc-cogs | 171bfacccb534d5e73bf53ce71e0a312c35e0ec7 | [
"MIT"
] | null | null | null | modnotes/modnotes.py | chasehult/misc-cogs | 171bfacccb534d5e73bf53ce71e0a312c35e0ec7 | [
"MIT"
] | null | null | null | modnotes/modnotes.py | chasehult/misc-cogs | 171bfacccb534d5e73bf53ce71e0a312c35e0ec7 | [
"MIT"
] | null | null | null | """
Utilities for managing moderator notes about users.
"""
import re
import discord
from redbot.core import checks
from redbot.core import commands
from redbot.core.bot import Red
from redbot.core.utils.chat_formatting import inline, box, pagify
from tsutils import CogSettings
class ModNotes(commands.Cog):
def... | 34.357664 | 102 | 0.626089 | import re
import discord
from redbot.core import checks
from redbot.core import commands
from redbot.core.bot import Red
from redbot.core.utils.chat_formatting import inline, box, pagify
from tsutils import CogSettings
class ModNotes(commands.Cog):
def __init__(self, bot: Red, *args, **kwargs):
super().... | true | true |
f71d75e458e3cb8f6494897fe66d3dc4ecbfc02d | 209 | py | Python | algorithms/1047. Remove All Adjacent Duplicates In String.py | woozway/py3-leetcode | e51a9ce7a6bb3e35c0fcb8c8f4f6cd5763708dbf | [
"MIT"
] | 1 | 2020-12-02T13:54:30.000Z | 2020-12-02T13:54:30.000Z | algorithms/1047. Remove All Adjacent Duplicates In String.py | woozway/py3-leetcode | e51a9ce7a6bb3e35c0fcb8c8f4f6cd5763708dbf | [
"MIT"
] | null | null | null | algorithms/1047. Remove All Adjacent Duplicates In String.py | woozway/py3-leetcode | e51a9ce7a6bb3e35c0fcb8c8f4f6cd5763708dbf | [
"MIT"
] | null | null | null | class Solution:
def removeDuplicates(self, S: str) -> str:
stack = []
for c in S:
if stack and stack[-1] == c:
stack.pop()
else:
stack.append(c)
return ''.join(stack)
| 20.9 | 44 | 0.5311 | class Solution:
def removeDuplicates(self, S: str) -> str:
stack = []
for c in S:
if stack and stack[-1] == c:
stack.pop()
else:
stack.append(c)
return ''.join(stack)
| true | true |
f71d7736dd803f04fc96aeb047ba3df44f0a3091 | 3,802 | py | Python | orttraining/orttraining/python/training/_ortmodule_utils.py | alexshuang/onnxruntime | 771a6d235b8495d05bcf6a906107df1bd6e81744 | [
"MIT"
] | null | null | null | orttraining/orttraining/python/training/_ortmodule_utils.py | alexshuang/onnxruntime | 771a6d235b8495d05bcf6a906107df1bd6e81744 | [
"MIT"
] | null | null | null | orttraining/orttraining/python/training/_ortmodule_utils.py | alexshuang/onnxruntime | 771a6d235b8495d05bcf6a906107df1bd6e81744 | [
"MIT"
] | null | null | null | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# --------------------------------------------------------------------------
from . import _utils
from onnxruntime.capi.onnxruntime_inference_collec... | 44.209302 | 117 | 0.675697 |
from . import _utils
from onnxruntime.capi.onnxruntime_inference_collection import OrtValue
from onnxruntime.capi import _pybind_state as C
import torch
from torch.utils.dlpack import from_dlpack, to_dlpack
from torch.utils.cpp_extension import load_inline
def _ortvalue_to_torch_tensor(ortvalue):
# an... | true | true |
f71d7757a47a3d5539caee900fabbeca9eb0d27c | 2,709 | py | Python | share/qt/extract_strings_qt.py | CoinStaging/Apollon | 0c78aa921244d67517ecb699b48767093e95de69 | [
"MIT"
] | 17 | 2020-03-21T21:03:31.000Z | 2021-04-07T18:45:38.000Z | share/qt/extract_strings_qt.py | CoinStaging/Apollon | 0c78aa921244d67517ecb699b48767093e95de69 | [
"MIT"
] | 8 | 2020-04-05T19:14:44.000Z | 2020-05-22T04:15:31.000Z | share/qt/extract_strings_qt.py | CoinStaging/Apollon | 0c78aa921244d67517ecb699b48767093e95de69 | [
"MIT"
] | 19 | 2020-03-04T19:32:03.000Z | 2021-11-16T04:27:14.000Z | #!/usr/bin/python
# Copyright (c) 2012-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Extract _("...") strings for translation and convert to Qt stringdefs so that
they can be picked up by Qt l... | 29.769231 | 105 | 0.641565 |
from __future__ import division,print_function,unicode_literals
from subprocess import Popen, PIPE
import glob
import operator
import os
import sys
OUT_CPP="qt/bitcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
messages = []
msgid = []
msgstr = []
in_msgid = False
in_msgstr = False
for ... | true | true |
f71d7805e1d138fa87506d9d152885ae11b2c0b8 | 8,756 | py | Python | cottontail/rabbitmq_management.py | 3lpsy/cottontail | fb7f364ea00bf6fe4b575818d562bd1df26407b9 | [
"BSD-3-Clause"
] | 21 | 2018-02-02T20:20:08.000Z | 2021-04-12T13:12:45.000Z | cottontail/rabbitmq_management.py | 3lpsy/cottontail | fb7f364ea00bf6fe4b575818d562bd1df26407b9 | [
"BSD-3-Clause"
] | 15 | 2017-08-21T08:41:03.000Z | 2020-11-25T22:05:43.000Z | cottontail/rabbitmq_management.py | 3lpsy/cottontail | fb7f364ea00bf6fe4b575818d562bd1df26407b9 | [
"BSD-3-Clause"
] | 6 | 2019-04-23T06:19:04.000Z | 2021-02-14T01:48:37.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Quentin Kaiser <kaiserquentin@gmail.com>
#
# let's disable 'too many public methods'
# pylint: disable=R0904
"""
rabbitmq-management HTTP API client.
Example:
rbmq = RabbitMQManagementClient('localhost')
rbmq.whoami()
.. _Google Python Style Guide:
... | 29.681356 | 86 | 0.559502 |
# pylint: disable=R0904
try:
from urllib.parse import quote
except ImportError:
from urllib import quote
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
class UnauthorizedAccessException(Exception):... | true | true |
f71d78df585dd1d4cbf186e5203991da862bdf93 | 1,237 | py | Python | esp8266_devicecloud.py | faludi/ESP8266_DeviceCloud | 3855e745d06050f4e988afe08208389ece7fbd15 | [
"MIT"
] | null | null | null | esp8266_devicecloud.py | faludi/ESP8266_DeviceCloud | 3855e745d06050f4e988afe08208389ece7fbd15 | [
"MIT"
] | null | null | null | esp8266_devicecloud.py | faludi/ESP8266_DeviceCloud | 3855e745d06050f4e988afe08208389ece7fbd15 | [
"MIT"
] | null | null | null | """
Example for posting data to Device Cloud for data graphing, storage and analysis.
(digi.com/products/cloud/digi-device-cloud)
by Rob Faludi, faludi.com
"""
import time
import httpclient
import ubinascii
version = '1.0.0'
username = 'your username here' #enter your username!
password = 'your password here'... | 27.488889 | 88 | 0.667745 |
import time
import httpclient
import ubinascii
version = '1.0.0'
username = 'your username here'
password = 'your password here'
url = 'http://devicecloud.digi.com/ws/v1/streams/history'
headers= {'authorization': 'Basic ' + auth}
stream_id = 'myStream'
stream_type = 'DOUBLE'
auth = ubinascii.b2a_base64(userna... | true | true |
f71d79ae1cce67c14af83bbfe117b78d09e46318 | 27,697 | py | Python | fmsynth.py | Paul-31415/soundplay | 0e7ea27c6d4bdf5f94e5034c7775a10c62d1583e | [
"MIT"
] | null | null | null | fmsynth.py | Paul-31415/soundplay | 0e7ea27c6d4bdf5f94e5034c7775a10c62d1583e | [
"MIT"
] | null | null | null | fmsynth.py | Paul-31415/soundplay | 0e7ea27c6d4bdf5f94e5034c7775a10c62d1583e | [
"MIT"
] | null | null | null |
from itools import lmbdWr,lm
import itertools
from bisect import bisect_right
import brailleG as gr
def abs2(n):
return (n*n.conjugate()).real
def fsample(buf,m=1,b=0):
index = 0
y = 0
while 1:
index = (index+b+m*y)%len(buf)
y = yield buf[(int(index)+1)%len(buf)]*(index%1)+bu... | 29.433581 | 183 | 0.490559 |
from itools import lmbdWr,lm
import itertools
from bisect import bisect_right
import brailleG as gr
def abs2(n):
return (n*n.conjugate()).real
def fsample(buf,m=1,b=0):
index = 0
y = 0
while 1:
index = (index+b+m*y)%len(buf)
y = yield buf[(int(index)+1)%len(buf)]*(index%1)+bu... | true | true |
f71d7c018fbe014e4ecc1d9b47bd5d36caccc271 | 29,722 | py | Python | certbot-nginx/certbot_nginx/_internal/parser.py | robszumski/certbot | d7050132c7468cbb08d3d717685a76b91d3c921a | [
"Apache-2.0"
] | 1 | 2021-09-24T22:27:06.000Z | 2021-09-24T22:27:06.000Z | certbot-nginx/certbot_nginx/_internal/parser.py | robszumski/certbot | d7050132c7468cbb08d3d717685a76b91d3c921a | [
"Apache-2.0"
] | 1 | 2021-09-24T22:22:21.000Z | 2021-09-24T22:22:21.000Z | certbot-nginx/certbot_nginx/_internal/parser.py | LaudateCorpus1/certbot | 3ec8b552a25b75d00d7693d52e6df93e5bd02a5f | [
"Apache-2.0"
] | 1 | 2021-09-24T22:22:11.000Z | 2021-09-24T22:22:11.000Z | """NginxParser is a member object of the NginxConfigurator class."""
import copy
import functools
import glob
import logging
import re
import pyparsing
import six
from acme.magic_typing import Dict
from acme.magic_typing import List
from acme.magic_typing import Set
from acme.magic_typing import Tuple
from acme.magic... | 38.903141 | 98 | 0.625866 | import copy
import functools
import glob
import logging
import re
import pyparsing
import six
from acme.magic_typing import Dict
from acme.magic_typing import List
from acme.magic_typing import Set
from acme.magic_typing import Tuple
from acme.magic_typing import Union
from certbot import errors
from certbot.compat i... | true | true |
f71d7c6696990d261b06073315046765fa6f1c50 | 2,131 | py | Python | src/predict-binary.py | accordinglyto/dferte | d4b8449c1633973dc538c9e72aca5d37802a4ee4 | [
"MIT"
] | null | null | null | src/predict-binary.py | accordinglyto/dferte | d4b8449c1633973dc538c9e72aca5d37802a4ee4 | [
"MIT"
] | 8 | 2020-11-13T18:55:17.000Z | 2022-03-12T00:34:40.000Z | src/predict-binary.py | accordinglyto/dferte | d4b8449c1633973dc538c9e72aca5d37802a4ee4 | [
"MIT"
] | null | null | null | import os
import numpy as np
#os.environ["KERAS_BACKEND"] = "plaidml.keras.backend"
from keras.preprocessing.image import ImageDataGenerator, load_img, img_to_array
from keras.models import Sequential, load_model
img_width, img_height = 48, 48
model_path = '../src/models/model.h5'
weights_path = '../src/models/weigh... | 22.670213 | 80 | 0.602065 | import os
import numpy as np
from keras.preprocessing.image import ImageDataGenerator, load_img, img_to_array
from keras.models import Sequential, load_model
img_width, img_height = 48, 48
model_path = '../src/models/model.h5'
weights_path = '../src/models/weights'
model = load_model(model_path)
test_path = '../dat... | true | true |
f71d7ce1e66742abde39bb83f3025bb50e93bbb1 | 56,871 | py | Python | src/python/tests/core/bot/tasks/fuzz_task_test.py | vschs007/clusterfuzz | 4b5e825abcd80d81d734a69b7457df59a6a9aa6e | [
"Apache-2.0"
] | null | null | null | src/python/tests/core/bot/tasks/fuzz_task_test.py | vschs007/clusterfuzz | 4b5e825abcd80d81d734a69b7457df59a6a9aa6e | [
"Apache-2.0"
] | null | null | null | src/python/tests/core/bot/tasks/fuzz_task_test.py | vschs007/clusterfuzz | 4b5e825abcd80d81d734a69b7457df59a6a9aa6e | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 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, ... | 36.738372 | 84 | 0.672153 |
from builtins import object
from builtins import range
import datetime
import mock
import os
import parameterized
import shutil
import tempfile
import time
import unittest
from pyfakefs import fake_filesystem_unittest
import six
from base import utils
from bot import testcase_manager
from bot.fuzzers im... | true | true |
f71d7d078b07d7f6a9b3225e4d976e6989b07bd6 | 9,268 | py | Python | faassupervisor/faas/aws_lambda/udocker.py | WinstonN/faas-supervisor | 9dadf7a34459a5c66d2b2828e8a79badc55a8758 | [
"Apache-2.0"
] | null | null | null | faassupervisor/faas/aws_lambda/udocker.py | WinstonN/faas-supervisor | 9dadf7a34459a5c66d2b2828e8a79badc55a8758 | [
"Apache-2.0"
] | null | null | null | faassupervisor/faas/aws_lambda/udocker.py | WinstonN/faas-supervisor | 9dadf7a34459a5c66d2b2828e8a79badc55a8758 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) GRyCAP - I3M - UPV
#
# 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... | 45.431373 | 108 | 0.65451 |
import subprocess
from faassupervisor.exceptions import ContainerImageNotFoundError
from faassupervisor.utils import SysUtils, FileUtils, ConfigUtils
from faassupervisor.logger import get_logger
from faassupervisor.exceptions import ContainerTimeoutExpiredWarning
from faassupervisor.faas.aws_lambda.functi... | true | true |
f71d7d40882346a998d1a79c9228b8c5ed1adc9f | 2,158 | py | Python | docs/conf.py | lengstrom/3db | 1d4a19600bcc43cf5637f7ee1d16887cba6308d5 | [
"MIT"
] | 1 | 2021-07-07T08:35:46.000Z | 2021-07-07T08:35:46.000Z | docs/conf.py | lengstrom/3db | 1d4a19600bcc43cf5637f7ee1d16887cba6308d5 | [
"MIT"
] | null | null | null | docs/conf.py | lengstrom/3db | 1d4a19600bcc43cf5637f7ee1d16887cba6308d5 | [
"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:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 33.2 | 79 | 0.664504 |
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
project = '3DB'
copyright = '2021, 3DB Team'
author = '3DB Team'
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.napoleon',
'sphinxcontrib.images'
]
templates_path = ['_templates']
excl... | true | true |
f71d7ddcd38a4dbbb52b93b7f2fc440f98a1ed76 | 9,835 | py | Python | grr/client/components/chipsec_support/grr_chipsec_test.py | panhania/grr | fe16a7311a528e31fe0e315a880e98273b8df960 | [
"Apache-2.0"
] | null | null | null | grr/client/components/chipsec_support/grr_chipsec_test.py | panhania/grr | fe16a7311a528e31fe0e315a880e98273b8df960 | [
"Apache-2.0"
] | null | null | null | grr/client/components/chipsec_support/grr_chipsec_test.py | panhania/grr | fe16a7311a528e31fe0e315a880e98273b8df960 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Test Chipsec client actions."""
import collections
import sys
import mock
from chipsec.helper import oshelper
from grr.client import vfs
from grr.client.components.chipsec_support.actions import chipsec_types
from grr.lib import flags
from grr.test_lib import client_test_lib
from grr.test_l... | 38.268482 | 78 | 0.729029 |
import collections
import sys
import mock
from chipsec.helper import oshelper
from grr.client import vfs
from grr.client.components.chipsec_support.actions import chipsec_types
from grr.lib import flags
from grr.test_lib import client_test_lib
from grr.test_lib import test_lib
class MockUnknownChipsetError(Runti... | true | true |
f71d7e44e4a12e49ae2b689e7ef43ea4b00aac94 | 3,032 | py | Python | statsSend/jenkins/jenkinsStatisticsSender.py | luigiberrettini/build-deploy-stats | 52a0bf5aeb8d2f8ef62e4e836eb0b9874dea500d | [
"MIT"
] | 2 | 2017-07-04T14:30:35.000Z | 2017-07-04T16:04:53.000Z | statsSend/jenkins/jenkinsStatisticsSender.py | luigiberrettini/build-deploy-stats | 52a0bf5aeb8d2f8ef62e4e836eb0b9874dea500d | [
"MIT"
] | null | null | null | statsSend/jenkins/jenkinsStatisticsSender.py | luigiberrettini/build-deploy-stats | 52a0bf5aeb8d2f8ef62e4e836eb0b9874dea500d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import xml.etree.ElementTree
from datetime import datetime, timedelta, timezone
from dateutil import parser
from statsSend.session import Session
from statsSend.utils import print_exception
from statsSend.urlBuilder import UrlBuilder
from statsSend.jenkins.jenkinsJob import JenkinsJob
class J... | 48.903226 | 139 | 0.66095 |
import xml.etree.ElementTree
from datetime import datetime, timedelta, timezone
from dateutil import parser
from statsSend.session import Session
from statsSend.utils import print_exception
from statsSend.urlBuilder import UrlBuilder
from statsSend.jenkins.jenkinsJob import JenkinsJob
class JenkinsStatisticsSender... | true | true |
f71d7f51e7ed402cc9736ce8ab91a8fab33564d5 | 1,467 | py | Python | general_tools/obs_tools.py | unfoldingWord-dev/tx-job-handler | 5364ed079bbd5b6528eeb6d12f2ca5c696e84f4f | [
"MIT"
] | 1 | 2020-11-25T04:07:37.000Z | 2020-11-25T04:07:37.000Z | general_tools/obs_tools.py | unfoldingWord-dev/tx-job-handler | 5364ed079bbd5b6528eeb6d12f2ca5c696e84f4f | [
"MIT"
] | 52 | 2018-10-25T05:49:30.000Z | 2022-03-16T22:31:57.000Z | general_tools/obs_tools.py | unfoldingWord-dev/tx-job-handler | 5364ed079bbd5b6528eeb6d12f2ca5c696e84f4f | [
"MIT"
] | null | null | null | import os
import markdown2
from bs4 import BeautifulSoup
def get_obs_chapter_data(repo_dir, chapter_num):
obs_chapter_data = {
'title': None,
'frames': [],
'bible_reference': None
}
obs_chapter_file = os.path.join(repo_dir, 'content', f'{chapter_num}.md')
if not os.path.isfile(... | 34.116279 | 86 | 0.512611 | import os
import markdown2
from bs4 import BeautifulSoup
def get_obs_chapter_data(repo_dir, chapter_num):
obs_chapter_data = {
'title': None,
'frames': [],
'bible_reference': None
}
obs_chapter_file = os.path.join(repo_dir, 'content', f'{chapter_num}.md')
if not os.path.isfile(... | true | true |
f71d7fa0ae2eee68a918e572b3e0809b5157731c | 434 | py | Python | awx/main/tests/unit/models/test_credential.py | gitEdouble/awx | 5885654405ccaf465f08df4db998a6dafebd9b4d | [
"Apache-2.0"
] | 1 | 2019-03-07T11:54:50.000Z | 2019-03-07T11:54:50.000Z | awx/main/tests/unit/models/test_credential.py | gitEdouble/awx | 5885654405ccaf465f08df4db998a6dafebd9b4d | [
"Apache-2.0"
] | 1 | 2020-04-09T08:43:28.000Z | 2020-04-09T08:43:28.000Z | awx/main/tests/unit/models/test_credential.py | gitEdouble/awx | 5885654405ccaf465f08df4db998a6dafebd9b4d | [
"Apache-2.0"
] | 2 | 2018-09-03T19:10:02.000Z | 2019-06-12T07:07:16.000Z | # -*- coding: utf-8 -*-
from awx.main.models import Credential, CredentialType
def test_unique_hash_with_unicode():
ct = CredentialType(name=u'Väult', kind='vault')
cred = Credential(
id=4,
name=u'Iñtërnâtiônàlizætiøn',
credential_type=ct,
inputs={
u'vault_id': u'�... | 24.111111 | 62 | 0.596774 |
from awx.main.models import Credential, CredentialType
def test_unique_hash_with_unicode():
ct = CredentialType(name=u'Väult', kind='vault')
cred = Credential(
id=4,
name=u'Iñtërnâtiônàlizætiøn',
credential_type=ct,
inputs={
u'vault_id': u'🐉🐉🐉'
},
... | true | true |
f71d7fe2e8cb699b6a0e6e27b481f5b65d9878c7 | 5,051 | py | Python | tests/test_warnings.py | fao89/drf-spectacular | 0dbd9d1c065f10aa1f8d472abd4795c05fb7b6c6 | [
"BSD-3-Clause"
] | null | null | null | tests/test_warnings.py | fao89/drf-spectacular | 0dbd9d1c065f10aa1f8d472abd4795c05fb7b6c6 | [
"BSD-3-Clause"
] | null | null | null | tests/test_warnings.py | fao89/drf-spectacular | 0dbd9d1c065f10aa1f8d472abd4795c05fb7b6c6 | [
"BSD-3-Clause"
] | 1 | 2021-06-14T16:42:20.000Z | 2021-06-14T16:42:20.000Z | from django.db import models
from rest_framework import mixins, serializers, views, viewsets
from rest_framework.authentication import BaseAuthentication
from rest_framework.decorators import action
from rest_framework.views import APIView
from drf_spectacular.utils import extend_schema
from tests import generate_sche... | 30.065476 | 87 | 0.706593 | from django.db import models
from rest_framework import mixins, serializers, views, viewsets
from rest_framework.authentication import BaseAuthentication
from rest_framework.decorators import action
from rest_framework.views import APIView
from drf_spectacular.utils import extend_schema
from tests import generate_sche... | true | true |
f71d7ff644e054571c43b78fa96b7e2e5f88fb9d | 22,213 | py | Python | sacred_mis/_sources/pomis2_57be95a71b575624c33c6ffe64e50d6e.py | T3p/baselines | 5623c9160d1e86ebca3e673f142fe6b14a1db06c | [
"MIT"
] | 2 | 2020-08-01T18:19:05.000Z | 2021-06-30T06:37:23.000Z | sacred_mis/_sources/pomis2_57be95a71b575624c33c6ffe64e50d6e.py | T3p/baselines | 5623c9160d1e86ebca3e673f142fe6b14a1db06c | [
"MIT"
] | null | null | null | sacred_mis/_sources/pomis2_57be95a71b575624c33c6ffe64e50d6e.py | T3p/baselines | 5623c9160d1e86ebca3e673f142fe6b14a1db06c | [
"MIT"
] | 5 | 2018-11-24T16:29:39.000Z | 2021-12-10T03:07:07.000Z | import numpy as np
import warnings
import baselines.common.tf_util as U
import tensorflow as tf
import time
from baselines.common import zipsame, colorize
from contextlib import contextmanager
from collections import deque
from baselines import logger
from baselines.common.cg import cg
from baselines.pomis2.memory impo... | 41.597378 | 183 | 0.620267 | import numpy as np
import warnings
import baselines.common.tf_util as U
import tensorflow as tf
import time
from baselines.common import zipsame, colorize
from contextlib import contextmanager
from collections import deque
from baselines import logger
from baselines.common.cg import cg
from baselines.pomis2.memory impo... | true | true |
f71d8034256591679beb03fa527db6b8505101de | 2,465 | py | Python | pymobiledevice3/services/web_protocol/cdp_server.py | iOSForensics/pymobiledevice3 | 6b148f4e58cc51cb44c18935913a3e6cec5b60d5 | [
"MIT"
] | 1 | 2022-01-20T16:53:15.000Z | 2022-01-20T16:53:15.000Z | pymobiledevice3/services/web_protocol/cdp_server.py | iOSForensics/pymobiledevice3 | 6b148f4e58cc51cb44c18935913a3e6cec5b60d5 | [
"MIT"
] | null | null | null | pymobiledevice3/services/web_protocol/cdp_server.py | iOSForensics/pymobiledevice3 | 6b148f4e58cc51cb44c18935913a3e6cec5b60d5 | [
"MIT"
] | null | null | null | import asyncio
import uuid
from fastapi import FastAPI, WebSocket
from fastapi.logger import logger
from pymobiledevice3.services.web_protocol.cdp_target import CdpTarget
from pymobiledevice3.services.web_protocol.session_protocol import SessionProtocol
from pymobiledevice3.services.webinspector import WirTypes
app ... | 32.866667 | 111 | 0.666531 | import asyncio
import uuid
from fastapi import FastAPI, WebSocket
from fastapi.logger import logger
from pymobiledevice3.services.web_protocol.cdp_target import CdpTarget
from pymobiledevice3.services.web_protocol.session_protocol import SessionProtocol
from pymobiledevice3.services.webinspector import WirTypes
app ... | true | true |
f71d8093d149be92f99d6a9576f78859def80b28 | 10,421 | py | Python | nmt_rouge.py | shengqiangzhang/transformer-pointer-generator-for-english-dataset- | 1ace22017647f06521db36de1ed99e02bce91355 | [
"MIT"
] | 7 | 2021-01-04T07:44:47.000Z | 2022-02-27T08:48:48.000Z | nmt_rouge.py | shengqiangzhang/transformer-pointer-generator-for-english-dataset- | 1ace22017647f06521db36de1ed99e02bce91355 | [
"MIT"
] | 1 | 2022-03-19T06:22:06.000Z | 2022-03-19T06:22:06.000Z | nmt_rouge.py | shengqiangzhang/transformer-pointer-generator-for-english-dataset- | 1ace22017647f06521db36de1ed99e02bce91355 | [
"MIT"
] | 2 | 2021-12-06T13:48:24.000Z | 2021-12-19T18:08:36.000Z | """ROUGE metric implementation.
Copy from tf_seq2seq/seq2seq/metrics/rouge.py.
This is a modified and slightly extended verison of
https://github.com/miso-belica/sumy/blob/valid/sumy/evaluation/rouge.py.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
f... | 29.521246 | 80 | 0.696286 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import itertools
import numpy as np
def _get_ngrams(n, text):
ngram_set = set()
text_length = len(text)
max_index_ngram_start = text_length - n
for i in rang... | true | true |
f71d816cb43be30dc40087bc3974ad2ed7599d34 | 17,478 | py | Python | readthedocs/api/v3/serializers.py | darrowco/readthedocs.org | fa7fc5a24306f1f6a27c7393f381c594ab29b357 | [
"MIT"
] | 1 | 2021-07-01T01:31:58.000Z | 2021-07-01T01:31:58.000Z | readthedocs/api/v3/serializers.py | darrowco/readthedocs.org | fa7fc5a24306f1f6a27c7393f381c594ab29b357 | [
"MIT"
] | 4 | 2020-06-05T22:35:21.000Z | 2021-12-13T20:10:17.000Z | readthedocs/api/v3/serializers.py | darrowco/readthedocs.org | fa7fc5a24306f1f6a27c7393f381c594ab29b357 | [
"MIT"
] | null | null | null | import datetime
import urllib
from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from rest_flex_fields import FlexFieldsModelSerializer
from rest_flex_fields.serializers import FlexFieldsSerializerMixin
from rest_framework import serializers
from ... | 28.419512 | 89 | 0.612198 | import datetime
import urllib
from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from rest_flex_fields import FlexFieldsModelSerializer
from rest_flex_fields.serializers import FlexFieldsSerializerMixin
from rest_framework import serializers
from ... | true | true |
f71d817086ba45a81765922769a674dd85882342 | 393 | py | Python | modules/post-exploitation/koadic.py | decidedlygray/ptf | f17f50606fac5ef30f42c0b5e0fa57b58f696b99 | [
"FTL"
] | 4,391 | 2015-05-12T19:30:45.000Z | 2022-03-30T13:39:27.000Z | modules/post-exploitation/koadic.py | decidedlygray/ptf | f17f50606fac5ef30f42c0b5e0fa57b58f696b99 | [
"FTL"
] | 340 | 2015-05-14T13:50:44.000Z | 2022-01-13T14:40:14.000Z | modules/post-exploitation/koadic.py | decidedlygray/ptf | f17f50606fac5ef30f42c0b5e0fa57b58f696b99 | [
"FTL"
] | 1,290 | 2015-05-13T00:24:58.000Z | 2022-03-30T08:20:22.000Z | AUTHOR="Jared Haight (@jaredhaight)"
DESCRIPTION="This module will install/update Koadic C3 (COM Command and Control Framework)"
INSTALL_TYPE="GIT"
REPOSITORY_LOCATION="https://github.com/zerosum0x0/koadic"
INSTALL_LOCATION="koadic"
DEBIAN="python,python-pip"
ARCHLINUX = "python,python-pip"
BYPASS_UPDATE="NO"
A... | 20.684211 | 91 | 0.78117 | AUTHOR="Jared Haight (@jaredhaight)"
DESCRIPTION="This module will install/update Koadic C3 (COM Command and Control Framework)"
INSTALL_TYPE="GIT"
REPOSITORY_LOCATION="https://github.com/zerosum0x0/koadic"
INSTALL_LOCATION="koadic"
DEBIAN="python,python-pip"
ARCHLINUX = "python,python-pip"
BYPASS_UPDATE="NO"
A... | true | true |
f71d8259f8b4b230a161329e0a9ccdf462508567 | 851 | py | Python | ml-agents/tests/yamato/standalone_build_tests.py | carlos-aguayo/ml-agents | 8ad72c08d7d9408c4dda4601beec7f8e82f911ed | [
"Apache-2.0"
] | 2 | 2020-12-01T20:46:13.000Z | 2021-03-07T16:17:45.000Z | ml-agents/tests/yamato/standalone_build_tests.py | carlos-aguayo/ml-agents | 8ad72c08d7d9408c4dda4601beec7f8e82f911ed | [
"Apache-2.0"
] | null | null | null | ml-agents/tests/yamato/standalone_build_tests.py | carlos-aguayo/ml-agents | 8ad72c08d7d9408c4dda4601beec7f8e82f911ed | [
"Apache-2.0"
] | null | null | null | import sys
import argparse
from .yamato_utils import get_base_path, run_standalone_build
def main(scene_path):
base_path = get_base_path()
print(f"Running in base path {base_path}")
executable_name = None
if scene_path is not None:
executable_name = scene_path.strip(".unity")
executa... | 25.029412 | 83 | 0.683901 | import sys
import argparse
from .yamato_utils import get_base_path, run_standalone_build
def main(scene_path):
base_path = get_base_path()
print(f"Running in base path {base_path}")
executable_name = None
if scene_path is not None:
executable_name = scene_path.strip(".unity")
executa... | true | true |
f71d82961476e1a195d28dbf87387de8e1e5007b | 13,636 | py | Python | stix2/test/v20/test_properties.py | emmanvg/cti-python-stix2 | d4c01157352552e2ec05bcf7b0f79ef96e34022d | [
"BSD-3-Clause"
] | 9 | 2017-07-03T19:01:23.000Z | 2020-02-20T19:22:49.000Z | stix2/test/v20/test_properties.py | emmanvg/cti-python-stix2 | d4c01157352552e2ec05bcf7b0f79ef96e34022d | [
"BSD-3-Clause"
] | 1 | 2017-05-30T14:13:27.000Z | 2017-05-30T14:13:27.000Z | stix2/test/v20/test_properties.py | emmanvg/cti-python-stix2 | d4c01157352552e2ec05bcf7b0f79ef96e34022d | [
"BSD-3-Clause"
] | 1 | 2017-05-26T19:17:14.000Z | 2017-05-26T19:17:14.000Z | import uuid
import pytest
import stix2
from stix2.exceptions import (
AtLeastOnePropertyError, CustomContentError, DictionaryKeyError,
)
from stix2.properties import (
BinaryProperty, BooleanProperty, DictionaryProperty,
EmbeddedObjectProperty, EnumProperty, ExtensionsProperty, FloatProperty,
HashesPr... | 26.022901 | 125 | 0.650704 | import uuid
import pytest
import stix2
from stix2.exceptions import (
AtLeastOnePropertyError, CustomContentError, DictionaryKeyError,
)
from stix2.properties import (
BinaryProperty, BooleanProperty, DictionaryProperty,
EmbeddedObjectProperty, EnumProperty, ExtensionsProperty, FloatProperty,
HashesPr... | true | true |
f71d846b2e00c72a66c869bc58ec2cd34e47a382 | 1,024 | py | Python | main.py | yuntan/crypkograph | 7715e195a1503f15d2e024dff5daf07c85cb63b1 | [
"MIT"
] | 26 | 2018-06-03T16:48:37.000Z | 2021-12-28T08:20:07.000Z | main.py | yuntan/crypkograph | 7715e195a1503f15d2e024dff5daf07c85cb63b1 | [
"MIT"
] | 1 | 2018-06-06T17:41:10.000Z | 2018-06-06T17:41:10.000Z | main.py | yuntan/crypkograph | 7715e195a1503f15d2e024dff5daf07c85cb63b1 | [
"MIT"
] | 7 | 2018-06-06T15:15:03.000Z | 2021-12-28T08:20:06.000Z | from os import mkdir
from bottle import route, get, request, static_file, run
from settings import PORT, DIR_CACHE, DIR_GRAPH
from crypkograph import render_graph
@route('/')
@route('/index.html')
def serve_html():
return static_file('index.html', '.')
@route('/static/<filename:path>')
def serve_static(filena... | 22.755556 | 69 | 0.673828 | from os import mkdir
from bottle import route, get, request, static_file, run
from settings import PORT, DIR_CACHE, DIR_GRAPH
from crypkograph import render_graph
@route('/')
@route('/index.html')
def serve_html():
return static_file('index.html', '.')
@route('/static/<filename:path>')
def serve_static(filena... | true | true |
f71d84bd199bff2d65b7447164541e907a3f533b | 3,063 | py | Python | weasyl/blocktag.py | Weasyl/weasyl | 80c86942c6f20a815086e2895fdad51d3aa77eed | [
"Apache-2.0"
] | 111 | 2016-05-18T04:18:18.000Z | 2021-11-03T02:05:19.000Z | weasyl/blocktag.py | Weasyl/weasyl | 80c86942c6f20a815086e2895fdad51d3aa77eed | [
"Apache-2.0"
] | 1,103 | 2016-05-29T05:17:53.000Z | 2022-03-31T18:12:40.000Z | weasyl/blocktag.py | Weasyl/weasyl | 80c86942c6f20a815086e2895fdad51d3aa77eed | [
"Apache-2.0"
] | 47 | 2016-05-29T20:48:37.000Z | 2021-11-12T09:40:40.000Z | from libweasyl import ratings
from libweasyl.cache import region
from weasyl import define as d
from weasyl import profile
from weasyl import searchtag
# For blocked tags, `rating` refers to the lowest rating for which that tag is
# blocked; for example, (X, Y, 10) would block tag Y for all ratings, whereas
# (X, Y, ... | 31.57732 | 119 | 0.627163 | from libweasyl import ratings
from libweasyl.cache import region
from weasyl import define as d
from weasyl import profile
from weasyl import searchtag
def check(userid, submitid=None, charid=None, journalid=None):
if not userid:
return False
if submitid:
map_table = "searchmapsubmit"
... | true | true |
f71d8544221be449972f7b45e2325ab14304a5db | 293 | py | Python | CodeChef/PRACTICE/Factorial - FCTRL.py | IshanManchanda/competitive-python | e9ee5fc48eaea0497ec13e8af5f89da6ac050526 | [
"MIT"
] | 6 | 2019-06-06T15:16:05.000Z | 2020-07-30T01:56:53.000Z | CodeChef/PRACTICE/Factorial - FCTRL.py | IshanManchanda/competitive-python | e9ee5fc48eaea0497ec13e8af5f89da6ac050526 | [
"MIT"
] | null | null | null | CodeChef/PRACTICE/Factorial - FCTRL.py | IshanManchanda/competitive-python | e9ee5fc48eaea0497ec13e8af5f89da6ac050526 | [
"MIT"
] | 1 | 2020-03-22T21:41:53.000Z | 2020-03-22T21:41:53.000Z | def main():
from sys import stdin, stdout
rl = stdin.readline
pl = stdout.write
int1 = int
str1 = str
xr = range
sum1 = sum
arr = [5]
for k in xr(1, 13):
arr[k] = arr[k - 1] * 5
for _ in xr(int1(rl())):
n = int1(rl())
c = sum1(n / i for i in arr)
pl(str1(c) + "\n")
main()
| 15.421053 | 30 | 0.549488 | def main():
from sys import stdin, stdout
rl = stdin.readline
pl = stdout.write
int1 = int
str1 = str
xr = range
sum1 = sum
arr = [5]
for k in xr(1, 13):
arr[k] = arr[k - 1] * 5
for _ in xr(int1(rl())):
n = int1(rl())
c = sum1(n / i for i in arr)
pl(str1(c) + "\n")
main()
| true | true |
f71d86f566cba857829800b557598795af8fd8ab | 1,145 | py | Python | irc_hooky/base_object.py | byorgey/irc-hooky | e78942b7e13ce273c40815863d0384dddfa52243 | [
"MIT"
] | 19 | 2016-01-26T18:36:38.000Z | 2022-03-12T02:32:01.000Z | irc_hooky/base_object.py | byorgey/irc-hooky | e78942b7e13ce273c40815863d0384dddfa52243 | [
"MIT"
] | 3 | 2016-01-29T19:43:25.000Z | 2019-03-11T20:21:11.000Z | irc_hooky/base_object.py | byorgey/irc-hooky | e78942b7e13ce273c40815863d0384dddfa52243 | [
"MIT"
] | 2 | 2016-03-01T09:23:07.000Z | 2020-04-01T21:53:51.000Z | from abc import ABCMeta
import logging
import json
class BaseObject(object):
__metaclass__ = ABCMeta
def __init__(self, **kwargs):
self.log = logging.getLogger("irchooky")
for prop in self.properties:
setattr(self, prop, kwargs.get(prop, ""))
def load(self, object_dict):
... | 29.358974 | 67 | 0.567686 | from abc import ABCMeta
import logging
import json
class BaseObject(object):
__metaclass__ = ABCMeta
def __init__(self, **kwargs):
self.log = logging.getLogger("irchooky")
for prop in self.properties:
setattr(self, prop, kwargs.get(prop, ""))
def load(self, object_dict):
... | true | true |
f71d870777dd8e99b39f2797adf52d842534def1 | 13,524 | py | Python | pyts/transformation/boss.py | NicolasHug/pyts | 29659fb09f568df2e7f8190f2d5a1c383dc7e9fa | [
"BSD-3-Clause"
] | 1 | 2019-10-19T12:03:20.000Z | 2019-10-19T12:03:20.000Z | pyts/transformation/boss.py | arita37/pyts | 29659fb09f568df2e7f8190f2d5a1c383dc7e9fa | [
"BSD-3-Clause"
] | null | null | null | pyts/transformation/boss.py | arita37/pyts | 29659fb09f568df2e7f8190f2d5a1c383dc7e9fa | [
"BSD-3-Clause"
] | 1 | 2020-01-09T11:34:35.000Z | 2020-01-09T11:34:35.000Z | """Code for Bag-of-SFA Symbols."""
# Author: Johann Faouzi <johann.faouzi@gmail.com>
# License: BSD-3-Clause
import numpy as np
from math import ceil
from scipy.sparse import csr_matrix
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.ut... | 38.311615 | 79 | 0.586957 |
import numpy as np
from math import ceil
from scipy.sparse import csr_matrix
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.utils.validation import check_array, check_is_fitted
from sklearn.utils.multiclass import check_classificatio... | true | true |
f71d87a97f28b6912c291299e2155b00941ed654 | 1,615 | py | Python | imcsdk/__init__.py | kenrusse/imcsdk | c35ec5d41072c3ea82c64b1b66e0650d1d873657 | [
"Apache-2.0"
] | null | null | null | imcsdk/__init__.py | kenrusse/imcsdk | c35ec5d41072c3ea82c64b1b66e0650d1d873657 | [
"Apache-2.0"
] | null | null | null | imcsdk/__init__.py | kenrusse/imcsdk | c35ec5d41072c3ea82c64b1b66e0650d1d873657 | [
"Apache-2.0"
] | null | null | null | # 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 applicable law or agreed to in writin... | 26.47541 | 92 | 0.721981 |
import os
import logging
import logging.handlers
log = logging.getLogger('imc')
console = logging.StreamHandler()
formatter = logging.Formatter(
'%(asctime)s - %(name)s - %(levelname)s - %(message)s')
console.setFormatter(formatter)
def enable_file_logging(filename="imcsdk.log"):
file_handler =... | true | true |
f71d8838f9ddabbae871e9cf39c1127d06d5da3b | 7,514 | py | Python | pysnmp/ROOMALERT3E-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/ROOMALERT3E-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/ROOMALERT3E-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module ROOMALERT3E-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ROOMALERT3E-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 20:50:01 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27... | 117.40625 | 795 | 0.746207 |
Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
SingleValueConstraint, ConstraintsIntersection, ValueSizeConstraint, ConstraintsUnion, ValueRangeConstraint = mibBuild... | true | true |
f71d889ea9aa7b8f833a526c4ae748e8ab7f962a | 708 | py | Python | rh/apps/meta/migrations/0005_metaattributes_image.py | rapidpro/chpro-microsite | 4e1d1210b49ec60ab0711d78235bf45eeb5c0275 | [
"BSD-3-Clause"
] | null | null | null | rh/apps/meta/migrations/0005_metaattributes_image.py | rapidpro/chpro-microsite | 4e1d1210b49ec60ab0711d78235bf45eeb5c0275 | [
"BSD-3-Clause"
] | 108 | 2018-01-30T15:26:18.000Z | 2021-06-10T17:29:57.000Z | rh/apps/meta/migrations/0005_metaattributes_image.py | rapidpro/chpro-microsite | 4e1d1210b49ec60ab0711d78235bf45eeb5c0275 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-04-04 05:44
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations
import django.db.models.deletion
import filer.fields.image
class Migration(migrations.Migration):
dependencies = [
migrations... | 28.32 | 152 | 0.696328 |
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations
import django.db.models.deletion
import filer.fields.image
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.FILER_IMAGE_MODEL),
('meta', '00... | true | true |
f71d8b088ea126f1b60b55d2095453b1d56c7fd9 | 207 | py | Python | src/lm/datasets/seq2seq.py | NeuroArchitect/lm | 036dcd9a49aa4f5b8b872f4e3a3b8821cbb0b060 | [
"Apache-2.0"
] | 1 | 2020-10-14T18:37:46.000Z | 2020-10-14T18:37:46.000Z | src/lm/datasets/seq2seq.py | shawwn/lm | 8f82f7e5933e8ec7498cbc147b801a729c80c7d3 | [
"Apache-2.0"
] | 2 | 2020-09-06T01:19:50.000Z | 2020-09-06T20:17:38.000Z | src/lm/datasets/seq2seq.py | shawwn/lm | 8f82f7e5933e8ec7498cbc147b801a729c80c7d3 | [
"Apache-2.0"
] | 1 | 2020-09-05T20:58:47.000Z | 2020-09-05T20:58:47.000Z | from typing import Optional
from pydantic import BaseModel
class Seq2SeqFormat(BaseModel):
vocab_size: int
context_length: int
has_eos: Optional[bool] = False
keys = ["content", "target"]
| 18.818182 | 35 | 0.719807 | from typing import Optional
from pydantic import BaseModel
class Seq2SeqFormat(BaseModel):
vocab_size: int
context_length: int
has_eos: Optional[bool] = False
keys = ["content", "target"]
| true | true |
f71d8b6368f70117f7b32ad062fc7597ae7b66dc | 3,726 | py | Python | cassette-calculator.py | BandW2011/cassette-calculator | b3a116a40a8c7a4872678ec4da6da5d1605584f8 | [
"MIT"
] | null | null | null | cassette-calculator.py | BandW2011/cassette-calculator | b3a116a40a8c7a4872678ec4da6da5d1605584f8 | [
"MIT"
] | null | null | null | cassette-calculator.py | BandW2011/cassette-calculator | b3a116a40a8c7a4872678ec4da6da5d1605584f8 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import time
def isTime(str):
try:
time.strptime(str, '%M:%S')
return True
except ValueError:
return False
def timeToSec(input):
return int(input.split(":")[0]) * 60 + int(input.split(":")[1])
def secToTime(input):
return str(input // 60) + ":" + '{:02d}'.fo... | 32.973451 | 150 | 0.496511 |
import time
def isTime(str):
try:
time.strptime(str, '%M:%S')
return True
except ValueError:
return False
def timeToSec(input):
return int(input.split(":")[0]) * 60 + int(input.split(":")[1])
def secToTime(input):
return str(input // 60) + ":" + '{:02d}'.format(input % 60)
... | true | true |
f71d8cd840396855122bd25a3c882b5f3a776d40 | 1,908 | py | Python | 12.py | mramendi/advent-of-code-2021 | 7cd98e6006659f42654b8fc126f06ebfba5774c0 | [
"CC0-1.0"
] | null | null | null | 12.py | mramendi/advent-of-code-2021 | 7cd98e6006659f42654b8fc126f06ebfba5774c0 | [
"CC0-1.0"
] | null | null | null | 12.py | mramendi/advent-of-code-2021 | 7cd98e6006659f42654b8fc126f06ebfba5774c0 | [
"CC0-1.0"
] | null | null | null | def how_many_paths_to_end(start_node,paths,no_go,exception_used,path_string):
'''
recursive walk
Parameters:
start_node (string) - the node from which we walk
paths (dict) - a dictionary where every node has a set of connected nodes
no_go (set) - a set of nodes that can not be visited as they a... | 36.692308 | 155 | 0.664046 | def how_many_paths_to_end(start_node,paths,no_go,exception_used,path_string):
new_path_string=path_string+" "+start_node
if start_node == "end":
w_no_go = no_go.copy()
if start_node[0].islower():
new_no_go.add(start_node)
count = 0
for connected_node in paths[start_node]:
... | true | true |
f71d8cdeec3da4e234767b37f0ad7f8ee3dad966 | 1,502 | py | Python | CODES/a_star_03.py | YashwanthYarala/MICROMOUSE | 69ba518ee81e1e6b70a13f7480844459d240ed11 | [
"MIT"
] | null | null | null | CODES/a_star_03.py | YashwanthYarala/MICROMOUSE | 69ba518ee81e1e6b70a13f7480844459d240ed11 | [
"MIT"
] | null | null | null | CODES/a_star_03.py | YashwanthYarala/MICROMOUSE | 69ba518ee81e1e6b70a13f7480844459d240ed11 | [
"MIT"
] | null | null | null | maze = [[0,0,0,0,0,0,0,0,0,0],
[0,1,1,1,1,1,1,1,1,0],
[0,1,1,1,1,1,1,1,1,0],
[0,1,1,1,1,1,1,1,1,0],
[0,1,1,1,1,1,1,1,1,0],
[0,1,1,1,1,1,1,1,1,0],
[0,1,1,1,1,1,1,1,1,0],
[0,1,1,1,1,1,1,1,1,0],
[0,1,1,1,1,1,1,1,1,0],
[0,0,0,0,0,0,0,0,0,0]]
# we start... | 20.861111 | 54 | 0.388815 | maze = [[0,0,0,0,0,0,0,0,0,0],
[0,1,1,1,1,1,1,1,1,0],
[0,1,1,1,1,1,1,1,1,0],
[0,1,1,1,1,1,1,1,1,0],
[0,1,1,1,1,1,1,1,1,0],
[0,1,1,1,1,1,1,1,1,0],
[0,1,1,1,1,1,1,1,1,0],
[0,1,1,1,1,1,1,1,1,0],
[0,1,1,1,1,1,1,1,1,0],
[0,0,0,0,0,0,0,0,0,0]]
a = 1
b =... | true | true |
f71d8eaac6d3bc9bc701b395bc1f1700b57e561f | 770 | py | Python | examples/research/proj/C3H6.py | fishjojo/pydmfe | 93cfc655314933d3531b5733521a1f95a044f6cb | [
"MIT"
] | 3 | 2021-02-26T06:26:00.000Z | 2022-02-20T08:58:20.000Z | examples/research/proj/C3H6.py | fishjojo/pydmfet | 93cfc655314933d3531b5733521a1f95a044f6cb | [
"MIT"
] | null | null | null | examples/research/proj/C3H6.py | fishjojo/pydmfet | 93cfc655314933d3531b5733521a1f95a044f6cb | [
"MIT"
] | null | null | null | from pydmfet import proj_ao
from pydmfet.qcwrap.pyscf_rks_ao import rks_ao
from pyscf import gto,scf
import numpy as np
from pyscf.tools import molden
from pyscf import lo
from pyscf.lo import iao,orth
from functools import reduce
import math
bas ='ccpvdz'
temp = 0.01
mol = gto.Mole()
mol.atom = open('C3H6.xyz').read... | 19.25 | 50 | 0.733766 | from pydmfet import proj_ao
from pydmfet.qcwrap.pyscf_rks_ao import rks_ao
from pyscf import gto,scf
import numpy as np
from pyscf.tools import molden
from pyscf import lo
from pyscf.lo import iao,orth
from functools import reduce
import math
bas ='ccpvdz'
temp = 0.01
mol = gto.Mole()
mol.atom = open('C3H6.xyz').read... | true | true |
f71d8ef2d5e34813e862d6041a815735fe0485fa | 2,893 | py | Python | src/python/pants/backend/python/pants_requirement.py | StephanErb/pants | a368267b6b4cf50138ba567f582409ed31bf5db9 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/python/pants_requirement.py | StephanErb/pants | a368267b6b4cf50138ba567f582409ed31bf5db9 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/python/pants_requirement.py | StephanErb/pants | a368267b6b4cf50138ba567f582409ed31bf5db9 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2015 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
from builtins import object
from pants.backend.python.python_requirement impor... | 44.507692 | 99 | 0.676115 |
from __future__ import absolute_import, division, print_function, unicode_literals
import os
from builtins import object
from pants.backend.python.python_requirement import PythonRequirement
from pants.base.build_environment import pants_version
from pants.base.exceptions import TargetDefinitionException
from pan... | true | true |
f71d9092e5371d5d2c143058ded24cb5f4ca1958 | 6,692 | py | Python | youtube_dl/extractor/gdcvault.py | aalvarito68/https-github.com-rg3-youtube-dl | dfc80bdd2e4ef3d30f161a93f99f3050537944ab | [
"Unlicense"
] | 24 | 2017-03-17T10:27:12.000Z | 2022-02-16T05:55:50.000Z | youtube_dl/extractor/gdcvault.py | travis-south/youtube-dl | dc89f968330fe9b2f0e56b07febc8cd57005f2c0 | [
"Unlicense"
] | 8 | 2017-12-05T23:45:54.000Z | 2022-02-09T23:28:51.000Z | youtube_dl/extractor/gdcvault.py | travis-south/youtube-dl | dc89f968330fe9b2f0e56b07febc8cd57005f2c0 | [
"Unlicense"
] | 6 | 2017-07-15T07:17:29.000Z | 2018-03-13T07:31:18.000Z | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
HEADRequest,
sanitized_Request,
urlencode_postdata,
)
class GDCVaultIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?gdcvault\.com/play/(?P<id>\d+)/(?P<name>(\w|-)+)?'
_NETRC_MACHINE = '... | 38.24 | 140 | 0.527794 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
HEADRequest,
sanitized_Request,
urlencode_postdata,
)
class GDCVaultIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?gdcvault\.com/play/(?P<id>\d+)/(?P<name>(\w|-)+)?'
_NETRC_MACHINE = '... | true | true |
f71d90b544b5058b7fccd9644f2bf263c8823742 | 2,339 | py | Python | Quantum Key Distribution/Mutation Testing/QKD Mutation Testing Cirq/Remove_mutant_2.py | Lilgabz/Quantum-Algorithm-Implementations | 2bb5df522d76e94b300275dfefff2869ff31bc2c | [
"MIT"
] | 1 | 2022-03-20T17:20:09.000Z | 2022-03-20T17:20:09.000Z | Quantum Key Distribution/Mutation Testing/QKD Mutation Testing Cirq/Remove_mutant_2.py | Lilgabz/Quantum-Algorithm-Implementations | 2bb5df522d76e94b300275dfefff2869ff31bc2c | [
"MIT"
] | null | null | null | Quantum Key Distribution/Mutation Testing/QKD Mutation Testing Cirq/Remove_mutant_2.py | Lilgabz/Quantum-Algorithm-Implementations | 2bb5df522d76e94b300275dfefff2869ff31bc2c | [
"MIT"
] | 2 | 2021-12-30T22:23:20.000Z | 2022-03-20T17:20:22.000Z | import unittest
import cirq
from cirq.ops import H, X, I
import random
import matplotlib.pyplot as plt
import numpy as np
from numpy.random import randint
import hypothesis.strategies as st
from hypothesis import given, settings
def generate_binary(len):
return randint(2, size=len)
def encode_message(bits, base... | 32.486111 | 60 | 0.57546 | import unittest
import cirq
from cirq.ops import H, X, I
import random
import matplotlib.pyplot as plt
import numpy as np
from numpy.random import randint
import hypothesis.strategies as st
from hypothesis import given, settings
def generate_binary(len):
return randint(2, size=len)
def encode_message(bits, base... | true | true |
f71d90e180f56bda6ddb0db33bef3d8021a809dc | 1,803 | py | Python | jotdx/parser/get_minute_time_data.py | jojoquant/jotdx | bc1cf478ddb262883d779d3c494877a767ebedd5 | [
"MIT"
] | null | null | null | jotdx/parser/get_minute_time_data.py | jojoquant/jotdx | bc1cf478ddb262883d779d3c494877a767ebedd5 | [
"MIT"
] | null | null | null | jotdx/parser/get_minute_time_data.py | jojoquant/jotdx | bc1cf478ddb262883d779d3c494877a767ebedd5 | [
"MIT"
] | null | null | null | # coding=utf-8
from jotdx.parser.base import BaseParser
from jotdx.helper import get_datetime, get_volume, get_price
from collections import OrderedDict
import struct
import six
class GetMinuteTimeData(BaseParser):
def setParams(self, market, code):
if type(code) is six.text_type:
code = code... | 23.723684 | 128 | 0.576262 |
from jotdx.parser.base import BaseParser
from jotdx.helper import get_datetime, get_volume, get_price
from collections import OrderedDict
import struct
import six
class GetMinuteTimeData(BaseParser):
def setParams(self, market, code):
if type(code) is six.text_type:
code = code.encode("utf-8... | true | true |
f71d91b6162a24bdd995d0f0381a0643a85de953 | 4,535 | py | Python | Chapter03/Chapter_3/musegen/musegen.py | YMandCL/Hands-On-Deep-Learning-for-Games | 0225661409c3bf59ae6b7996c254bb485ebd10cb | [
"MIT"
] | 33 | 2018-12-29T15:39:20.000Z | 2022-03-18T14:36:11.000Z | Chapter03/Chapter_3/musegen/musegen.py | YMandCL/Hands-On-Deep-Learning-for-Games | 0225661409c3bf59ae6b7996c254bb485ebd10cb | [
"MIT"
] | 4 | 2019-05-01T08:30:47.000Z | 2020-08-14T21:13:53.000Z | Chapter03/Chapter_3/musegen/musegen.py | YMandCL/Hands-On-Deep-Learning-for-Games | 0225661409c3bf59ae6b7996c254bb485ebd10cb | [
"MIT"
] | 14 | 2019-01-13T15:52:08.000Z | 2021-10-10T06:14:39.000Z | # Currently this script is configured to use the note-generator model.
from config import sequence_length, output_dir, note_generator_dir
from helper import loadChorales, loadModelAndWeights, createPitchSpecificVocabularies, createDurationVocabularySpecific
from music21 import note, instrument, stream, duration
import... | 39.094828 | 138 | 0.704961 |
from config import sequence_length, output_dir, note_generator_dir
from helper import loadChorales, loadModelAndWeights, createPitchSpecificVocabularies, createDurationVocabularySpecific
from music21 import note, instrument, stream, duration
import numpy as np
import os
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID... | true | true |
f71d92446ac29000ec218291728624b2d6598670 | 295 | py | Python | feature_extraction.py | LFRusso/kinnect-keyboard | 52c4a205528d524ae07eb15c15f3f08300110635 | [
"MIT"
] | null | null | null | feature_extraction.py | LFRusso/kinnect-keyboard | 52c4a205528d524ae07eb15c15f3f08300110635 | [
"MIT"
] | null | null | null | feature_extraction.py | LFRusso/kinnect-keyboard | 52c4a205528d524ae07eb15c15f3f08300110635 | [
"MIT"
] | null | null | null | import mahotas as mt
from skimage.feature import hog
def extract_features(img_gray, img_mask):
zernike = mt.features.zernike_moments(img_gray, 3)
fd = hog(img_mask, orientations=9, pixels_per_cell=(8, 8),
cells_per_block=(2, 2))
return list(zernike)+list(fd) | 36.875 | 62 | 0.688136 | import mahotas as mt
from skimage.feature import hog
def extract_features(img_gray, img_mask):
zernike = mt.features.zernike_moments(img_gray, 3)
fd = hog(img_mask, orientations=9, pixels_per_cell=(8, 8),
cells_per_block=(2, 2))
return list(zernike)+list(fd) | true | true |
f71d939ead9c998360910e553be21fdb201e464c | 341 | py | Python | setup.py | Edward-FitzSimons/TetrisAgent_ML | 191a8c198941444d6dda8374eac796d8455ba003 | [
"MIT"
] | null | null | null | setup.py | Edward-FitzSimons/TetrisAgent_ML | 191a8c198941444d6dda8374eac796d8455ba003 | [
"MIT"
] | null | null | null | setup.py | Edward-FitzSimons/TetrisAgent_ML | 191a8c198941444d6dda8374eac796d8455ba003 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(
name="tetrisRL",
version="0.5",
author="Jay Butera",
author_email="buterajay@gmail.com",
license="MIT",
url="https://github.com/jaybutera/tetrisRL",
packages=find_packages(),
install_requires=[
'numpy>=1.13',
... | 21.3125 | 49 | 0.592375 | from setuptools import setup, find_packages
setup(
name="tetrisRL",
version="0.5",
author="Jay Butera",
author_email="buterajay@gmail.com",
license="MIT",
url="https://github.com/jaybutera/tetrisRL",
packages=find_packages(),
install_requires=[
'numpy>=1.13',
... | true | true |
f71d93e8560f437371b035f0098f804c534076a4 | 524 | py | Python | hw1/connect_cisco_dict.py | rshetty07/pyneta | bb82d516ae3727161a5f77c3a6a5f4294f6e0ba1 | [
"Apache-2.0"
] | null | null | null | hw1/connect_cisco_dict.py | rshetty07/pyneta | bb82d516ae3727161a5f77c3a6a5f4294f6e0ba1 | [
"Apache-2.0"
] | null | null | null | hw1/connect_cisco_dict.py | rshetty07/pyneta | bb82d516ae3727161a5f77c3a6a5f4294f6e0ba1 | [
"Apache-2.0"
] | null | null | null | from netmiko import ConnectHandler
from getpass import getpass
device1 = {
"host": 'cisco3.lasthop.io',
"username": 'pyclass',
"password": getpass(),
"device_type": 'cisco_ios',
# "session_log": 'my_session.txt'
}
device2 = {
"host": 'cisco4.lasthop.io',
"username": 'pyclass',
"passwor... | 22.782609 | 42 | 0.645038 | from netmiko import ConnectHandler
from getpass import getpass
device1 = {
"host": 'cisco3.lasthop.io',
"username": 'pyclass',
"password": getpass(),
"device_type": 'cisco_ios',
}
device2 = {
"host": 'cisco4.lasthop.io',
"username": 'pyclass',
"password": getpass(),
"device_type": 'c... | true | true |
f71d94a79dd3fc9185f2556c95a6d1391c0ca76d | 4,023 | py | Python | bin/GetUSGSNLCDForDEMExtent.py | selimnairb/EcohydroLib | 38aa4020c88a57c9d2f1fb66acd393b6e989e897 | [
"Unlicense"
] | 12 | 2015-03-03T05:08:55.000Z | 2021-01-27T12:38:33.000Z | bin/GetUSGSNLCDForDEMExtent.py | selimnairb/EcohydroLib | 38aa4020c88a57c9d2f1fb66acd393b6e989e897 | [
"Unlicense"
] | 3 | 2016-01-04T15:05:43.000Z | 2019-02-01T02:19:45.000Z | bin/GetUSGSNLCDForDEMExtent.py | selimnairb/EcohydroLib | 38aa4020c88a57c9d2f1fb66acd393b6e989e897 | [
"Unlicense"
] | 5 | 2015-02-15T18:20:38.000Z | 2017-05-21T13:14:32.000Z | #!/usr/bin/env python
"""@package GetUSGSNLCDForBoundingbox
@brief Download NLCD 2006 or 2011 data hosted by U.S. Geological Survey Web
Coverage Service (WCS) interface.
This software is provided free of charge under the New BSD License. Please see
the following license information:
Copyright (c) 2015, University o... | 49.666667 | 143 | 0.712155 |
import sys
import os
import argparse
import traceback
from ecohydrolib.command.exceptions import *
from ecohydrolib.command.landcover import USGSWCSNLCD, KNOWN_LC_TYPES, DEFAULT_LC_TYPE
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Download NLCD data via USGS-hosted WCS web servic... | true | true |
f71d9562c12f81854e60e618863958ef2c14c867 | 2,016 | py | Python | tests/pytests/functional/cli/test_salt_cloud.py | babs/salt | c536ea716d5308880b244e7980f4b659d86fc104 | [
"Apache-2.0"
] | 9,425 | 2015-01-01T05:59:24.000Z | 2022-03-31T20:44:05.000Z | tests/pytests/functional/cli/test_salt_cloud.py | babs/salt | c536ea716d5308880b244e7980f4b659d86fc104 | [
"Apache-2.0"
] | 33,507 | 2015-01-01T00:19:56.000Z | 2022-03-31T23:48:20.000Z | tests/pytests/functional/cli/test_salt_cloud.py | babs/salt | c536ea716d5308880b244e7980f4b659d86fc104 | [
"Apache-2.0"
] | 5,810 | 2015-01-01T19:11:45.000Z | 2022-03-31T02:37:20.000Z | """
tests.pytests.integration.cli.test_salt_cloud
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
import pytest
pytest.importorskip("libcloud", reason="salt-cloud requires >= libcloud 0.11.4")
def test_function_arguments(salt_cloud_cli):
ret = salt_cloud_cli.run("--function", "show_image", "-h")
assert ret... | 35.368421 | 85 | 0.672619 | import pytest
pytest.importorskip("libcloud", reason="salt-cloud requires >= libcloud 0.11.4")
def test_function_arguments(salt_cloud_cli):
ret = salt_cloud_cli.run("--function", "show_image", "-h")
assert ret.exitcode != 0
assert (
"error: --function expects two arguments: <function-name> <provi... | true | true |
f71d9631429f556fd55add33baaf1526744d5702 | 22,864 | py | Python | nipype/interfaces/slicer/generate_classes.py | koenhelwegen/nipype | 87d04aeb4cb78c95345506a0e5e3571d380ed1d1 | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/slicer/generate_classes.py | koenhelwegen/nipype | 87d04aeb4cb78c95345506a0e5e3571d380ed1d1 | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/slicer/generate_classes.py | koenhelwegen/nipype | 87d04aeb4cb78c95345506a0e5e3571d380ed1d1 | [
"Apache-2.0"
] | 1 | 2020-10-22T12:50:23.000Z | 2020-10-22T12:50:23.000Z | # -*- coding: utf-8 -*-
"""This script generates Slicer Interfaces based on the CLI modules XML. CLI
modules are selected from the hardcoded list below and generated code is placed
in the cli_modules.py file (and imported in __init__.py). For this to work
correctly you must have your CLI executabes in $PATH"""
import x... | 37.729373 | 212 | 0.532497 |
import xml.dom.minidom
import subprocess
import os
from shutil import rmtree
import keyword
python_keywords = (
keyword.kwlist
)
def force_to_valid_python_variable_name(old_name):
new_name = old_name
new_name = new_name.lstrip().rstrip()
if old_name in python_keywords:
new_name = "opt_" +... | true | true |
f71d993fda551358cdcb47a5d1ebc884dfe12422 | 1,056 | py | Python | trains_gtfs.py | rome2rio/TokyoGTFS | c641529cd4e1d84692e85060dacb710270bc235f | [
"MIT"
] | 10 | 2018-10-24T13:49:18.000Z | 2022-02-06T22:58:34.000Z | trains_gtfs.py | rome2rio/TokyoGTFS | c641529cd4e1d84692e85060dacb710270bc235f | [
"MIT"
] | null | null | null | trains_gtfs.py | rome2rio/TokyoGTFS | c641529cd4e1d84692e85060dacb710270bc235f | [
"MIT"
] | 6 | 2019-04-17T03:57:29.000Z | 2021-01-26T11:44:53.000Z | import argparse
import time
import sys
import os
from src.static_trains import TrainParser
from src.const import HEADER
if __name__ == "__main__":
args_parser = argparse.ArgumentParser()
args_parser.add_argument("-a", "--apikey", metavar="YOUR_APIKEY",
help="apikey from developer... | 27.076923 | 82 | 0.609848 | import argparse
import time
import sys
import os
from src.static_trains import TrainParser
from src.const import HEADER
if __name__ == "__main__":
args_parser = argparse.ArgumentParser()
args_parser.add_argument("-a", "--apikey", metavar="YOUR_APIKEY",
help="apikey from developer... | true | true |
f71d9afb951ff91df5b86f95e1126ec3220aa334 | 2,020 | py | Python | treetensor/torch/__init__.py | opendilab/DI-treetensor | fe5f681123c3d6e8d7507fba38586d2edf12e693 | [
"Apache-2.0"
] | 45 | 2021-09-04T15:57:44.000Z | 2022-03-11T19:28:56.000Z | treetensor/torch/__init__.py | opendilab/DI-treetensor | fe5f681123c3d6e8d7507fba38586d2edf12e693 | [
"Apache-2.0"
] | 7 | 2021-09-06T13:06:12.000Z | 2022-03-03T13:38:05.000Z | treetensor/torch/__init__.py | opendilab/DI-treetensor | fe5f681123c3d6e8d7507fba38586d2edf12e693 | [
"Apache-2.0"
] | 1 | 2021-09-30T15:18:06.000Z | 2021-09-30T15:18:06.000Z | import builtins
from functools import lru_cache
from types import ModuleType, FunctionType, BuiltinFunctionType
from typing import Iterable
import torch
from .funcs import *
from .funcs import __all__ as _funcs_all
from .funcs.base import get_func_from_torch
from .size import *
from .size import __all__ as _size_all
... | 32.063492 | 108 | 0.681683 | import builtins
from functools import lru_cache
from types import ModuleType, FunctionType, BuiltinFunctionType
from typing import Iterable
import torch
from .funcs import *
from .funcs import __all__ as _funcs_all
from .funcs.base import get_func_from_torch
from .size import *
from .size import __all__ as _size_all
... | true | true |
f71d9c7d4d1edc3d1f3f51bfea2e872d5c549f44 | 1,047 | py | Python | 64-minimum-path-sum/64-minimum-path-sum.py | jurayev/data-structures-algorithms-solutions | 7103294bafb60117fc77efe4913edcffbeb1ac7a | [
"MIT"
] | null | null | null | 64-minimum-path-sum/64-minimum-path-sum.py | jurayev/data-structures-algorithms-solutions | 7103294bafb60117fc77efe4913edcffbeb1ac7a | [
"MIT"
] | null | null | null | 64-minimum-path-sum/64-minimum-path-sum.py | jurayev/data-structures-algorithms-solutions | 7103294bafb60117fc77efe4913edcffbeb1ac7a | [
"MIT"
] | null | null | null | class Solution:
def minPathSum(self, grid: List[List[int]]) -> int:
"""
[1,3,1]
[1,5,1]
[4,2,1]
time O (nm)
space O(nm)
state -> sums[r][c] = min path sum till r, c position
initial state -> sums[0][0…cols] = inf
-> sums... | 31.727273 | 84 | 0.455587 | class Solution:
def minPathSum(self, grid: List[List[int]]) -> int:
return self.find_min_path_sum(grid)
def find_min_path_sum(self, grid):
rows, cols = len(grid), len(grid[0])
if not rows or not cols:
return -1
sums = [[float("inf") for _ in range(cols+1)] for _ ... | true | true |
f71d9d0a976dd2d6fab7c86d11a2c85c733baff5 | 11,274 | py | Python | tfx/orchestration/kubeflow/executor_wrappers.py | HassanDayoub/tfx | dc9221abbb8dad991d1ae22fb91876da1290efae | [
"Apache-2.0"
] | 2 | 2019-07-08T20:56:13.000Z | 2020-08-04T17:07:26.000Z | tfx/orchestration/kubeflow/executor_wrappers.py | HassanDayoub/tfx | dc9221abbb8dad991d1ae22fb91876da1290efae | [
"Apache-2.0"
] | null | null | null | tfx/orchestration/kubeflow/executor_wrappers.py | HassanDayoub/tfx | dc9221abbb8dad991d1ae22fb91876da1290efae | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 35.23125 | 90 | 0.699219 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import abc
import argparse
import json
import os
import re
from future import utils
import six
import tensorflow as tf
from typing import Any, Dict, List, Text
from tensorflow.python.lib.io import... | true | true |
f71d9d8f6b820ccbcff9a86dd6bbf0941792f053 | 2,110 | py | Python | src/djask/admin/views.py | greyli/Djask | b886610c792aaa40d6a3975fd26c44fc7825c8b6 | [
"MIT"
] | null | null | null | src/djask/admin/views.py | greyli/Djask | b886610c792aaa40d6a3975fd26c44fc7825c8b6 | [
"MIT"
] | null | null | null | src/djask/admin/views.py | greyli/Djask | b886610c792aaa40d6a3975fd26c44fc7825c8b6 | [
"MIT"
] | null | null | null | from typing import Optional
from flask import render_template, abort, flash, redirect, url_for
from flask_login.utils import login_user, logout_user
from .forms import LoginForm
from .decorators import admin_required
from ..auth.models import User
from ..blueprints import Blueprint
from ..globals import current_app, ... | 30.57971 | 86 | 0.690521 | from typing import Optional
from flask import render_template, abort, flash, redirect, url_for
from flask_login.utils import login_user, logout_user
from .forms import LoginForm
from .decorators import admin_required
from ..auth.models import User
from ..blueprints import Blueprint
from ..globals import current_app, ... | true | true |
f71d9ef0e4be00ca05ee0dfe3d9ea824198afb50 | 57,881 | py | Python | kafka/admin/client.py | jtribble/kafka-python | bbb8c90391e446de81833bc38dba4233a781fa5b | [
"Apache-2.0"
] | null | null | null | kafka/admin/client.py | jtribble/kafka-python | bbb8c90391e446de81833bc38dba4233a781fa5b | [
"Apache-2.0"
] | null | null | null | kafka/admin/client.py | jtribble/kafka-python | bbb8c90391e446de81833bc38dba4233a781fa5b | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from collections import defaultdict
import copy
import logging
import socket
from . import ConfigResourceType
from kafka.vendor import six
from kafka.client_async import KafkaClient, selectors
import kafka.errors as Errors
from kafka.errors import (
IncompatibleBrokerVersio... | 46.3048 | 162 | 0.640988 | from __future__ import absolute_import
from collections import defaultdict
import copy
import logging
import socket
from . import ConfigResourceType
from kafka.vendor import six
from kafka.client_async import KafkaClient, selectors
import kafka.errors as Errors
from kafka.errors import (
IncompatibleBrokerVersio... | true | true |
f71d9f5f3241fcead0f224c1faf1af11464dc292 | 1,236 | py | Python | feincms/module/extensions/seo.py | barseghyanartur/feincms | 7a319f78c5a5cd0c60e6141d1221f3c7a0d4a7f0 | [
"BSD-3-Clause"
] | 1 | 2016-05-07T11:50:28.000Z | 2016-05-07T11:50:28.000Z | feincms/module/extensions/seo.py | barseghyanartur/feincms | 7a319f78c5a5cd0c60e6141d1221f3c7a0d4a7f0 | [
"BSD-3-Clause"
] | null | null | null | feincms/module/extensions/seo.py | barseghyanartur/feincms | 7a319f78c5a5cd0c60e6141d1221f3c7a0d4a7f0 | [
"BSD-3-Clause"
] | 1 | 2019-03-15T19:36:34.000Z | 2019-03-15T19:36:34.000Z | """
Add a keyword and a description field which are helpful for SEO optimization.
"""
from __future__ import absolute_import, unicode_literals
from django.db import models
from django.utils.translation import ugettext_lazy as _
from feincms import extensions
class Extension(extensions.Extension):
def handle_mo... | 34.333333 | 77 | 0.636731 |
from __future__ import absolute_import, unicode_literals
from django.db import models
from django.utils.translation import ugettext_lazy as _
from feincms import extensions
class Extension(extensions.Extension):
def handle_model(self):
self.model.add_to_class('meta_keywords', models.TextField(
... | true | true |
f71da02dc1dd8dc3b72ea75a423abc1e89aa3bf5 | 293 | py | Python | eggs/bx_python-0.7.1_7b95ff194725-py2.7-linux-x86_64-ucs4.egg/bx/pwm/_position_weight_matrix.py | bopopescu/phyG | 023f505b705ab953f502cbc55e90612047867583 | [
"CC-BY-3.0"
] | 1 | 2019-07-29T02:53:51.000Z | 2019-07-29T02:53:51.000Z | eggs/bx_python-0.7.1_7b95ff194725-py2.7-linux-x86_64-ucs4.egg/bx/pwm/_position_weight_matrix.py | bopopescu/phyG | 023f505b705ab953f502cbc55e90612047867583 | [
"CC-BY-3.0"
] | 1 | 2021-09-11T14:30:32.000Z | 2021-09-11T14:30:32.000Z | eggs/bx_python-0.7.1_7b95ff194725-py2.7-linux-x86_64-ucs4.egg/bx/pwm/_position_weight_matrix.py | bopopescu/phyG | 023f505b705ab953f502cbc55e90612047867583 | [
"CC-BY-3.0"
] | 2 | 2016-12-19T02:27:46.000Z | 2019-07-29T02:53:54.000Z | def __bootstrap__():
global __bootstrap__, __loader__, __file__
import sys, pkg_resources, imp
__file__ = pkg_resources.resource_filename(__name__,'_position_weight_matrix.so')
__loader__ = None; del __bootstrap__, __loader__
imp.load_dynamic(__name__,__file__)
__bootstrap__()
| 36.625 | 84 | 0.795222 | def __bootstrap__():
global __bootstrap__, __loader__, __file__
import sys, pkg_resources, imp
__file__ = pkg_resources.resource_filename(__name__,'_position_weight_matrix.so')
__loader__ = None; del __bootstrap__, __loader__
imp.load_dynamic(__name__,__file__)
__bootstrap__()
| true | true |
f71da18676c625d83bf9f11496ad2774d4ad9b06 | 348 | py | Python | main.py | filiptronicek/github-rank-action | d3f675233ccc26162cf0b70e825cd717f3b2b1d3 | [
"MIT"
] | 1 | 2020-07-22T21:46:10.000Z | 2020-07-22T21:46:10.000Z | main.py | filiptronicek/github-rank-action | d3f675233ccc26162cf0b70e825cd717f3b2b1d3 | [
"MIT"
] | null | null | null | main.py | filiptronicek/github-rank-action | d3f675233ccc26162cf0b70e825cd717f3b2b1d3 | [
"MIT"
] | null | null | null | import requests, json
from sys import argv
from modify import write
country = "czech_republic"
url = f"https://top-ghusers.vercel.app/api?c={country}"
responce = requests.get(url)
resJson = json.loads(responce.text)
for user in resJson['users']:
if user['user']['username'] == argv[1]:
write(user['rank'])... | 24.857143 | 55 | 0.678161 | import requests, json
from sys import argv
from modify import write
country = "czech_republic"
url = f"https://top-ghusers.vercel.app/api?c={country}"
responce = requests.get(url)
resJson = json.loads(responce.text)
for user in resJson['users']:
if user['user']['username'] == argv[1]:
write(user['rank'])... | true | true |
f71da18e1e0bbfc1e0daede493d7642be9502b6b | 18,868 | py | Python | src/msc/datagroups/__init__.py | magicbadger/python-dabmsc | fe4f2e195ffe0b0d75f4766893df687563e857a1 | [
"Apache-2.0"
] | null | null | null | src/msc/datagroups/__init__.py | magicbadger/python-dabmsc | fe4f2e195ffe0b0d75f4766893df687563e857a1 | [
"Apache-2.0"
] | null | null | null | src/msc/datagroups/__init__.py | magicbadger/python-dabmsc | fe4f2e195ffe0b0d75f4766893df687563e857a1 | [
"Apache-2.0"
] | 2 | 2021-10-15T01:29:38.000Z | 2022-03-22T06:05:35.000Z | from msc import bitarray_to_hex, int_to_bitarray, calculate_crc, InvalidCrcError, generate_transport_id
from mot import DirectoryEncoder, SortedHeaderInformation
from bitarray import bitarray
import logging
import types
import itertools
logger = logging.getLogger('msc.datagroups')
MAX_SEGMENT_SIZE=8189 # maximum data... | 40.928416 | 283 | 0.621741 | from msc import bitarray_to_hex, int_to_bitarray, calculate_crc, InvalidCrcError, generate_transport_id
from mot import DirectoryEncoder, SortedHeaderInformation
from bitarray import bitarray
import logging
import types
import itertools
logger = logging.getLogger('msc.datagroups')
MAX_SEGMENT_SIZE=8189
HEADER = 3
... | true | true |
f71da1cb4f5c3c2a1b177350a4e50eb0d6673de5 | 3,568 | py | Python | benchmark/benchmark_SingleOrigin.py | maptube/UMaaS | 0758d8352213f332546d728f3eb02411c16c97ac | [
"MIT"
] | null | null | null | benchmark/benchmark_SingleOrigin.py | maptube/UMaaS | 0758d8352213f332546d728f3eb02411c16c97ac | [
"MIT"
] | null | null | null | benchmark/benchmark_SingleOrigin.py | maptube/UMaaS | 0758d8352213f332546d728f3eb02411c16c97ac | [
"MIT"
] | null | null | null | import timeit
import os.path
import numpy as np
from math import exp, fabs
from sys import float_info
from globals import *
from utils import loadMatrix, resizeMatrix
from models.SingleOrigin import SingleOrigin
"""
Benchmarks for the Single Origin Constrained model (models/SingleOrigin.py)
All code here is lifted f... | 35.68 | 119 | 0.668442 | import timeit
import os.path
import numpy as np
from math import exp, fabs
from sys import float_info
from globals import *
from utils import loadMatrix, resizeMatrix
from models.SingleOrigin import SingleOrigin
=loadMatrix(os.path.join(modelRunsDir,TObs31Filename))
cij=loadMatrix(os.path.join(modelRunsDir,CijRoad... | true | true |
f71da3dcf19d3269f76e23ee85ee43c5f96e9665 | 1,047 | py | Python | lib/surface/healthcare/consent_stores/__init__.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 2 | 2019-11-10T09:17:07.000Z | 2019-12-18T13:44:08.000Z | lib/surface/healthcare/consent_stores/__init__.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | null | null | null | lib/surface/healthcare/consent_stores/__init__.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 1 | 2020-07-25T01:40:19.000Z | 2020-07-25T01:40:19.000Z | # -*- coding: utf-8 -*- #
# Copyright 2020 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 36.103448 | 74 | 0.759312 |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.calliope import base
@base.ReleaseTracks(base.ReleaseTrack.ALPHA, base.ReleaseTrack.BETA,
base.ReleaseTrack.GA)
class ConsentStores(base.Group):
| true | true |
f71da4622f2c54b555de3eae3160f218b25dc007 | 4,261 | py | Python | io_scene_niftools/properties/collision.py | reddraconi/blender_nif_plugin | a4cd7545ccff952fa99bdf66dc043e00372de2ee | [
"BSD-3-Clause"
] | 1 | 2021-10-18T00:35:25.000Z | 2021-10-18T00:35:25.000Z | io_scene_niftools/properties/collision.py | luxaritas/blender_niftools_addon | 704c40d7edabea292ddb2da875fd3ff1bf354d4a | [
"BSD-3-Clause"
] | 2 | 2020-11-06T21:37:09.000Z | 2020-12-06T20:33:59.000Z | io_scene_niftools/properties/collision.py | luxaritas/blender_niftools_addon | 704c40d7edabea292ddb2da875fd3ff1bf354d4a | [
"BSD-3-Clause"
] | null | null | null | """Nif User Interface, custom nif properties store for collisions settings"""
# ***** BEGIN LICENSE BLOCK *****
#
# Copyright © 2014, NIF File Format Library and Tools contributors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided th... | 36.732759 | 103 | 0.681295 |
from bpy.props import (PointerProperty,
IntProperty,
BoolProperty,
EnumProperty,
FloatProperty,
)
from bpy.types import PropertyGroup
from pyffi.formats.nif import Nif... | true | true |
f71da48478c4aa6e386c6265a0ace72a8f997f99 | 2,394 | py | Python | month05/Spider/day07_course/day07_code/Tencent-demo/Tencent/spiders/tencent.py | chaofan-zheng/python_learning_code | 5d05848911d55aa49eaee4afd7ffd80536fad7aa | [
"Apache-2.0"
] | 4 | 2021-01-07T14:25:15.000Z | 2021-02-01T10:36:10.000Z | month05/Spider/day07_course/day07_code/Tencent-demo/Tencent/spiders/tencent.py | chaofan-zheng/python_learning_code | 5d05848911d55aa49eaee4afd7ffd80536fad7aa | [
"Apache-2.0"
] | null | null | null | month05/Spider/day07_course/day07_code/Tencent-demo/Tencent/spiders/tencent.py | chaofan-zheng/python_learning_code | 5d05848911d55aa49eaee4afd7ffd80536fad7aa | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import scrapy
import requests
from ..items import TencentItem
import json
class TencentSpider(scrapy.Spider):
name = 'tencent'
allowed_domains = ['careers.tencent.com']
one_url = 'https://careers.tencent.com/tencentcareer/api/post/Query?timestamp=1608216394591&countryId=&cityId=&bgI... | 39.9 | 230 | 0.645781 |
import scrapy
import requests
from ..items import TencentItem
import json
class TencentSpider(scrapy.Spider):
name = 'tencent'
allowed_domains = ['careers.tencent.com']
one_url = 'https://careers.tencent.com/tencentcareer/api/post/Query?timestamp=1608216394591&countryId=&cityId=&bgIds=&productId=&category... | true | true |
f71da4be567bb4884b3e8f840b280ee3f5884d41 | 35,504 | py | Python | sympy/solvers/pde.py | harsh-98/sympy | 53fc684467088cdf0acccb6ad770cbde97e32268 | [
"BSD-3-Clause"
] | null | null | null | sympy/solvers/pde.py | harsh-98/sympy | 53fc684467088cdf0acccb6ad770cbde97e32268 | [
"BSD-3-Clause"
] | null | null | null | sympy/solvers/pde.py | harsh-98/sympy | 53fc684467088cdf0acccb6ad770cbde97e32268 | [
"BSD-3-Clause"
] | null | null | null | """
This module contains pdsolve() and different helper functions that it
uses. It is heavily inspired by the ode module and hence the basic
infrastructure remains the same.
**Functions in this module**
These are the user functions in this module:
- pdsolve() - Solves PDE's
- classify_pde() - Classif... | 35.2572 | 133 | 0.550614 | from __future__ import print_function, division
from itertools import combinations_with_replacement
from sympy.simplify import simplify
from sympy.core import Add, S
from sympy.core.compatibility import (reduce, is_sequence, range)
from sympy.core.function import Function, expand, AppliedUndef, Subs
from sympy.core.re... | true | true |
f71da5ee1e04a350be35e6e930db6f799a4b2850 | 2,221 | py | Python | tests/fixtures/transaction.py | nickderobertis/flexlate | 81d6dbc2d87219a2a89266d6e8fb03310a24a3a1 | [
"MIT"
] | null | null | null | tests/fixtures/transaction.py | nickderobertis/flexlate | 81d6dbc2d87219a2a89266d6e8fb03310a24a3a1 | [
"MIT"
] | 25 | 2021-12-05T18:57:53.000Z | 2022-03-29T13:45:47.000Z | tests/fixtures/transaction.py | nickderobertis/flexlate | 81d6dbc2d87219a2a89266d6e8fb03310a24a3a1 | [
"MIT"
] | null | null | null | from uuid import UUID
import pytest
from flexlate.transactions.transaction import FlexlateTransaction, TransactionType
ADD_SOURCE_ID = UUID("93f984ca-6e8f-45e9-b9b0-aebebfe798c1")
ADD_OUTPUT_ID = UUID("86465f4d-9752-4ae5-aaa7-791b4c814e8d")
ADD_SOURCE_AND_OUTPUT_ID = UUID("bf4cd42c-10b1-4bf9-a15f-294f5be738b0")
REMO... | 33.149254 | 86 | 0.815398 | from uuid import UUID
import pytest
from flexlate.transactions.transaction import FlexlateTransaction, TransactionType
ADD_SOURCE_ID = UUID("93f984ca-6e8f-45e9-b9b0-aebebfe798c1")
ADD_OUTPUT_ID = UUID("86465f4d-9752-4ae5-aaa7-791b4c814e8d")
ADD_SOURCE_AND_OUTPUT_ID = UUID("bf4cd42c-10b1-4bf9-a15f-294f5be738b0")
REMO... | true | true |
f71da789b8896079130d361bbef9e9e5d5278187 | 55 | py | Python | aox/boilerplate/boilerplates/__init__.py | costas-basdekis/aox | 63a90fb722f29d9b2d26041f9035f99b6b21615e | [
"MIT"
] | 2 | 2021-11-10T22:38:49.000Z | 2021-12-03T08:09:01.000Z | aox/boilerplate/boilerplates/__init__.py | costas-basdekis/aox | 63a90fb722f29d9b2d26041f9035f99b6b21615e | [
"MIT"
] | null | null | null | aox/boilerplate/boilerplates/__init__.py | costas-basdekis/aox | 63a90fb722f29d9b2d26041f9035f99b6b21615e | [
"MIT"
] | null | null | null | from .default_boilerplate import * # noqa: F401, F403
| 27.5 | 54 | 0.745455 | from .default_boilerplate import *
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.