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 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c3811440d74220dd7bffff3f385c4c72624d706 | 1,410 | py | Python | aliyun-python-sdk-iot/aliyunsdkiot/request/v20180120/GetSolutionProjectRequest.py | hetw/aliyun-openapi-python-sdk | 7443eacee9fbbaa93c7975c6dbec92d3c364c577 | [
"Apache-2.0"
] | 1 | 2020-12-05T03:03:46.000Z | 2020-12-05T03:03:46.000Z | aliyun-python-sdk-iot/aliyunsdkiot/request/v20180120/GetSolutionProjectRequest.py | hetw/aliyun-openapi-python-sdk | 7443eacee9fbbaa93c7975c6dbec92d3c364c577 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-iot/aliyunsdkiot/request/v20180120/GetSolutionProjectRequest.py | hetw/aliyun-openapi-python-sdk | 7443eacee9fbbaa93c7975c6dbec92d3c364c577 | [
"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 file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 37.105263 | 77 | 0.762411 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkiot.endpoint import endpoint_data
class GetSolutionProjectRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Iot', '2018-01-20', 'GetSolutionProject','iot')
self.set_method('POST')
if hasattr(self, "endpoint_map"):
... | true | true |
1c381191fd02c120142d8e495da7630cc597a6f6 | 5,020 | py | Python | ImageCollection/creating_monthly_imagery.py | c11/earthengine-py-notebooks | 144b57e4d952da095ba73c3cc8ce2f36291162ff | [
"MIT"
] | 1 | 2020-05-31T14:19:59.000Z | 2020-05-31T14:19:59.000Z | ImageCollection/creating_monthly_imagery.py | c11/earthengine-py-notebooks | 144b57e4d952da095ba73c3cc8ce2f36291162ff | [
"MIT"
] | null | null | null | ImageCollection/creating_monthly_imagery.py | c11/earthengine-py-notebooks | 144b57e4d952da095ba73c3cc8ce2f36291162ff | [
"MIT"
] | null | null | null | # %%
"""
<table class="ee-notebook-buttons" align="left">
<td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/ImageCollection/creating_monthly_imagery.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td>
<t... | 44.035088 | 1,021 | 0.72988 |
import subprocess
try:
import geemap
except ImportError:
print('geemap package not installed. Installing ...')
subprocess.check_call(["python", '-m', 'pip', 'install', 'geemap'])
try:
import google.colab
import geemap.eefolium as emap
except:
import geemap as emap
import ee
try:
... | true | true |
1c3811eb1bcfd3a389599e1e45c66e928a92ecbd | 1,552 | py | Python | ocean_lib/web3_internal/web3_provider.py | surajsjain/ocean.py | 2e853db94d9aee2a0cf6b3d58f714215b83d917b | [
"Apache-2.0"
] | 4 | 2021-07-05T20:21:41.000Z | 2021-09-02T14:13:26.000Z | ocean_lib/web3_internal/web3_provider.py | surajsjain/ocean.py | 2e853db94d9aee2a0cf6b3d58f714215b83d917b | [
"Apache-2.0"
] | null | null | null | ocean_lib/web3_internal/web3_provider.py | surajsjain/ocean.py | 2e853db94d9aee2a0cf6b3d58f714215b83d917b | [
"Apache-2.0"
] | 1 | 2021-03-25T15:04:12.000Z | 2021-03-25T15:04:12.000Z | # Copyright 2018 Ocean Protocol Foundation
# SPDX-License-Identifier: Apache-2.0
from web3 import Web3
from ocean_lib.web3_internal.web3_overrides.http_provider import CustomHTTPProvider
class Web3Provider(object):
"""Provides the Web3 instance."""
_web3 = None
@staticmethod
def init_web3(network... | 33.73913 | 83 | 0.680412 |
from web3 import Web3
from ocean_lib.web3_internal.web3_overrides.http_provider import CustomHTTPProvider
class Web3Provider(object):
_web3 = None
@staticmethod
def init_web3(network_url=None, provider=None):
if not provider:
assert network_url, 'network_url or a provider instance... | true | true |
1c381276560525e28dd4d871bc30a8106e9e988a | 11,793 | py | Python | train_custom.py | NISH1001/NeuralNLP-NeuralClassifier | e86f750e68879d7390f0037747336110085d2f44 | [
"Apache-2.0"
] | null | null | null | train_custom.py | NISH1001/NeuralNLP-NeuralClassifier | e86f750e68879d7390f0037747336110085d2f44 | [
"Apache-2.0"
] | null | null | null | train_custom.py | NISH1001/NeuralNLP-NeuralClassifier | e86f750e68879d7390f0037747336110085d2f44 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding:utf-8
"""
Tencent is pleased to support the open source community by making NeuralClassifier available.
Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance
with the Licen... | 38.413681 | 108 | 0.639447 |
import os
import shutil
import sys
import time
import torch
from torch.utils.data import DataLoader
import util
from config import Config
from dataset.classification_dataset import ClassificationDataset
from dataset.collator import (
ClassificationCollator,
ClassificationType,
FastTextCollator,
)
from ... | true | true |
1c38147a6ea3da84d1f04a3af0ccac44a07efe58 | 1,505 | py | Python | scripts/hail_batch/hgdp1kg_tobwgs_pca_pop_densified/hgdp_1kg_tob_wgs_pop_pca_densified.py | populationgenomics/ancestry | faf6fd4bc3a1f8b2a2adb7e59cf584d4bfdf79e6 | [
"MIT"
] | null | null | null | scripts/hail_batch/hgdp1kg_tobwgs_pca_pop_densified/hgdp_1kg_tob_wgs_pop_pca_densified.py | populationgenomics/ancestry | faf6fd4bc3a1f8b2a2adb7e59cf584d4bfdf79e6 | [
"MIT"
] | 21 | 2021-03-09T06:35:59.000Z | 2022-02-21T22:56:15.000Z | scripts/hail_batch/hgdp1kg_tobwgs_pca_pop_densified/hgdp_1kg_tob_wgs_pop_pca_densified.py | populationgenomics/ancestry | faf6fd4bc3a1f8b2a2adb7e59cf584d4bfdf79e6 | [
"MIT"
] | null | null | null | """
Perform pca on samples specific to a population
from the HGDP,1KG, and tob-wgs dataset after densifying.
Depends on hgdp1kg_tobwgs_densified_pca/hgdp_1kg_tob_wgs_densified_pca.py
"""
import click
import pandas as pd
import hail as hl
HGDP1KG_TOBWGS = (
'gs://cpg-tob-wgs-main/1kg_hgdp_densified_pca/v2/'
'... | 30.1 | 80 | 0.694352 |
import click
import pandas as pd
import hail as hl
HGDP1KG_TOBWGS = (
'gs://cpg-tob-wgs-main/1kg_hgdp_densified_pca/v2/'
'hgdp1kg_tobwgs_joined_all_samples.mt'
)
@click.command()
@click.option('--output', help='GCS output path', required=True)
@click.option('--pop', help='Population to subset from the 1KG (... | true | true |
1c3815183ab119a099f4a64a2c1d15811a0d3803 | 41,453 | py | Python | bin/grade_item.py | hifiadi/Submitty | 62a8239313cff7e3f841ff66aeda6b0557e9c15b | [
"BSD-3-Clause"
] | null | null | null | bin/grade_item.py | hifiadi/Submitty | 62a8239313cff7e3f841ff66aeda6b0557e9c15b | [
"BSD-3-Clause"
] | null | null | null | bin/grade_item.py | hifiadi/Submitty | 62a8239313cff7e3f841ff66aeda6b0557e9c15b | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import argparse
import configparser
import json
import os
import tempfile
import shutil
import subprocess
import stat
import time
import dateutil
import dateutil.parser
import urllib.parse
import contextlib
from submitty_utils import dateutils, glob
import grade_items_logging
import write_grade... | 47.811995 | 164 | 0.628784 |
import argparse
import configparser
import json
import os
import tempfile
import shutil
import subprocess
import stat
import time
import dateutil
import dateutil.parser
import urllib.parse
import contextlib
from submitty_utils import dateutils, glob
import grade_items_logging
import write_grade_history
import insert... | true | true |
1c381534cc1a0c3b535cbeb1dd6c0032c08a3f00 | 24,752 | py | Python | geo/Geoserver.py | hixi/geoserver-rest | 5fb642a811aac129b2fedc52db452664e19948ad | [
"MIT"
] | null | null | null | geo/Geoserver.py | hixi/geoserver-rest | 5fb642a811aac129b2fedc52db452664e19948ad | [
"MIT"
] | null | null | null | geo/Geoserver.py | hixi/geoserver-rest | 5fb642a811aac129b2fedc52db452664e19948ad | [
"MIT"
] | null | null | null | import pycurl
import os
import io
import requests
from .Style import coverage_style_xml, outline_only_xml, catagorize_xml, classified_xml
from .Calculation_gdal import raster_value
from .Postgres import Db
# call back class for read the data
class DataProvider(object):
def __init__(self, data):
self.data... | 41.391304 | 194 | 0.567227 | import pycurl
import os
import io
import requests
from .Style import coverage_style_xml, outline_only_xml, catagorize_xml, classified_xml
from .Calculation_gdal import raster_value
from .Postgres import Db
class DataProvider(object):
def __init__(self, data):
self.data = data
self.finished = Fal... | true | true |
1c38153ff6a00e8391f1f37e5535a6931f4300d1 | 1,420 | py | Python | libcst/codemod/commands/remove_unused_imports.py | hauntsaninja/LibCST | c023fa7c4caff3fd2b3946080f9a58b539b10363 | [
"Apache-2.0"
] | 1 | 2021-01-18T09:50:29.000Z | 2021-01-18T09:50:29.000Z | libcst/codemod/commands/remove_unused_imports.py | hauntsaninja/LibCST | c023fa7c4caff3fd2b3946080f9a58b539b10363 | [
"Apache-2.0"
] | null | null | null | libcst/codemod/commands/remove_unused_imports.py | hauntsaninja/LibCST | c023fa7c4caff3fd2b3946080f9a58b539b10363 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
from libcst import Import, ImportFrom
from libcst.codemod import VisitorBasedCodemodCommand
from libcst.codemod.visitors import RemoveImport... | 37.368421 | 79 | 0.73169 |
from libcst import Import, ImportFrom
from libcst.codemod import VisitorBasedCodemodCommand
from libcst.codemod.visitors import RemoveImportsVisitor
class RemoveUnusedImportsCommand(VisitorBasedCodemodCommand):
DESCRIPTION: str = (
"Remove all imports that are not used in a file. "
"Note: o... | true | true |
1c38165279bfe6c52173422aaa75695043294582 | 1,755 | py | Python | encoder.py | MR3z4/FileEncoder | 62cb257a970ea35351381bdaaaca6c5c1e2650da | [
"MIT"
] | null | null | null | encoder.py | MR3z4/FileEncoder | 62cb257a970ea35351381bdaaaca6c5c1e2650da | [
"MIT"
] | null | null | null | encoder.py | MR3z4/FileEncoder | 62cb257a970ea35351381bdaaaca6c5c1e2650da | [
"MIT"
] | null | null | null | import base64
import hashlib
from Crypto import Random
from Crypto.Cipher import AES
import io
import os
class AESCipher(object):
def __init__(self, key):
self.bs = AES.block_size
self.key = hashlib.sha256(key.encode()).digest()
def encrypt(self, raw):
raw = self._pad(raw)
iv ... | 35.1 | 88 | 0.602849 | import base64
import hashlib
from Crypto import Random
from Crypto.Cipher import AES
import io
import os
class AESCipher(object):
def __init__(self, key):
self.bs = AES.block_size
self.key = hashlib.sha256(key.encode()).digest()
def encrypt(self, raw):
raw = self._pad(raw)
iv ... | true | true |
1c38168d7fcd7013b9f49f6a899e4486f4958e63 | 830 | py | Python | maza/modules/creds/cameras/canon/ssh_default_creds.py | ArturSpirin/maza | 56ae6325c08bcedd22c57b9fe11b58f1b38314ca | [
"MIT"
] | 2 | 2020-02-06T20:24:31.000Z | 2022-03-08T19:07:16.000Z | maza/modules/creds/cameras/canon/ssh_default_creds.py | ArturSpirin/maza | 56ae6325c08bcedd22c57b9fe11b58f1b38314ca | [
"MIT"
] | null | null | null | maza/modules/creds/cameras/canon/ssh_default_creds.py | ArturSpirin/maza | 56ae6325c08bcedd22c57b9fe11b58f1b38314ca | [
"MIT"
] | null | null | null | from maza.core.exploit import *
from maza.modules.creds.generic.ssh_default import Exploit as SSHDefault
class Exploit(SSHDefault):
__info__ = {
"name": "Canon Camera Default SSH Creds",
"description": "Module performs dictionary attack against Canon Camera SSH service. "
"I... | 36.086957 | 97 | 0.625301 | from maza.core.exploit import *
from maza.modules.creds.generic.ssh_default import Exploit as SSHDefault
class Exploit(SSHDefault):
__info__ = {
"name": "Canon Camera Default SSH Creds",
"description": "Module performs dictionary attack against Canon Camera SSH service. "
"I... | true | true |
1c3816d4bd01e2dbb6eb65167b4a5c06a59dfd2c | 2,066 | py | Python | profiles_api/models.py | venky-web/profiles-rest-api | ad57d0591dd130eb5395f1b24a80e1e6cce05c66 | [
"MIT"
] | null | null | null | profiles_api/models.py | venky-web/profiles-rest-api | ad57d0591dd130eb5395f1b24a80e1e6cce05c66 | [
"MIT"
] | null | null | null | profiles_api/models.py | venky-web/profiles-rest-api | ad57d0591dd130eb5395f1b24a80e1e6cce05c66 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import AbstractBaseUser
from django.contrib.auth.models import PermissionsMixin
from django.contrib.auth.models import BaseUserManager
from django.conf import settings
class UserProfileManager(BaseUserManager):
"""Manager for user profiles"""
def c... | 28.694444 | 64 | 0.679574 | from django.db import models
from django.contrib.auth.models import AbstractBaseUser
from django.contrib.auth.models import PermissionsMixin
from django.contrib.auth.models import BaseUserManager
from django.conf import settings
class UserProfileManager(BaseUserManager):
def create_user(self, email, name, passwo... | true | true |
1c3817446f0e68a59131ed664303965871399618 | 1,360 | py | Python | nipype/interfaces/fsl/tests/test_auto_UnaryMaths.py | grlee77/nipype | 73f3a733ac1b7d9b09ec32a387905a9302423b87 | [
"BSD-3-Clause"
] | null | null | null | nipype/interfaces/fsl/tests/test_auto_UnaryMaths.py | grlee77/nipype | 73f3a733ac1b7d9b09ec32a387905a9302423b87 | [
"BSD-3-Clause"
] | null | null | null | nipype/interfaces/fsl/tests/test_auto_UnaryMaths.py | grlee77/nipype | 73f3a733ac1b7d9b09ec32a387905a9302423b87 | [
"BSD-3-Clause"
] | null | null | null | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.fsl.maths import UnaryMaths
def test_UnaryMaths_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash=Tr... | 24.727273 | 78 | 0.639706 |
from nipype.testing import assert_equal
from nipype.interfaces.fsl.maths import UnaryMaths
def test_UnaryMaths_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
usedefault=True,
),
in_file=dict(args... | true | true |
1c3819ecfdc0c1ae228c062d65e2afd7c8027e58 | 4,371 | py | Python | gallery/settings.py | ngishjonathan/gallery | dd67f28887316d6277927c667f6641d26317b0b8 | [
"MIT"
] | null | null | null | gallery/settings.py | ngishjonathan/gallery | dd67f28887316d6277927c667f6641d26317b0b8 | [
"MIT"
] | 3 | 2020-06-05T21:34:27.000Z | 2021-09-08T01:04:15.000Z | gallery/settings.py | ngishjonathan/gallery | dd67f28887316d6277927c667f6641d26317b0b8 | [
"MIT"
] | null | null | null | """
Django settings for pic_galore project.
Generated by 'django-admin startproject' using Django 1.11.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os
i... | 27.31875 | 91 | 0.693892 |
import os
import django_heroku
import dj_database_url
from decouple import config,Csv
MODE=config("MODE", default="dev")
SECRET_KEY = config('SECRET_KEY')
DEBUG = config('DEBUG', default=False, cast=bool)
if config('MODE')=="dev":
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgres... | true | true |
1c381b77ecc033b4fd6d7878f73d92f197379b61 | 12,693 | py | Python | userbot/utils/tools.py | dennisdwntr/Zelda-Ubot | 59db6ae1c62b43e604bbe848bbbe153b75ba306f | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 2 | 2021-12-27T02:23:24.000Z | 2021-12-28T06:25:39.000Z | userbot/utils/tools.py | dennisdwntr/Zelda-Ubot | 59db6ae1c62b43e604bbe848bbbe153b75ba306f | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/utils/tools.py | dennisdwntr/Zelda-Ubot | 59db6ae1c62b43e604bbe848bbbe153b75ba306f | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 5 | 2021-12-27T02:23:06.000Z | 2022-02-05T08:33:06.000Z | # Copyright (C) 2020 Adek Maulana
#
# SPDX-License-Identifier: GPL-3.0-or-later
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later v... | 31.7325 | 146 | 0.628929 |
import asyncio
import hashlib
import os
import os.path
import re
import shlex
import time
from os.path import basename
from typing import Optional, Union
from emoji import get_emoji_regexp
from hachoir.metadata import extractMetadata
from hachoir.parser import createParser
from html_telegraph_pos... | true | true |
1c381bd488d74c3243afb1591b0d03d34cf4facd | 6,691 | py | Python | RumourEval2019Models/Bert-MFajcik/utils/utils.py | isspek/veracity-detection | 9368309722bead209e49e52c206758e3d173092a | [
"MIT"
] | null | null | null | RumourEval2019Models/Bert-MFajcik/utils/utils.py | isspek/veracity-detection | 9368309722bead209e49e52c206758e3d173092a | [
"MIT"
] | null | null | null | RumourEval2019Models/Bert-MFajcik/utils/utils.py | isspek/veracity-detection | 9368309722bead209e49e52c206758e3d173092a | [
"MIT"
] | null | null | null | __author__ = "Martin Fajčík"
import math
import socket
import torch
import datetime
import logging
import logging.config
import os
import yaml
from collections import Iterable
class LevelOnly(object):
levels = {
"CRITICAL": 50,
"ERROR": 40,
"WARNING": 30,
"INFO": 20,
"DEB... | 30.834101 | 112 | 0.582125 | __author__ = "Martin Fajčík"
import math
import socket
import torch
import datetime
import logging
import logging.config
import os
import yaml
from collections import Iterable
class LevelOnly(object):
levels = {
"CRITICAL": 50,
"ERROR": 40,
"WARNING": 30,
"INFO": 20,
"DEB... | true | true |
1c381bff5a8cdd500a30b54d5bda3ef6e6606c31 | 611 | py | Python | pal/model/generic/register.py | mars-research/pal | 5977394cda8750ff5dcb89c2bf193ec1ef4cd137 | [
"MIT"
] | 26 | 2020-01-06T23:53:17.000Z | 2022-02-01T08:58:21.000Z | pal/model/generic/register.py | mars-research/pal | 5977394cda8750ff5dcb89c2bf193ec1ef4cd137 | [
"MIT"
] | 30 | 2019-11-13T00:55:22.000Z | 2022-01-06T08:09:35.000Z | pal/model/generic/register.py | mars-research/pal | 5977394cda8750ff5dcb89c2bf193ec1ef4cd137 | [
"MIT"
] | 14 | 2019-11-15T16:56:22.000Z | 2021-12-22T10:14:17.000Z | from dataclasses import dataclass, field as datafield
from typing import List, Dict
from pal.model.register import Register
from pal.model.access_mechanism import AbstractAccessMechanism
@dataclass
class GenericRegister(Register):
""" Models a generic register that does not belong to a particular """
""" mic... | 27.772727 | 74 | 0.657938 | from dataclasses import dataclass, field as datafield
from typing import List, Dict
from pal.model.register import Register
from pal.model.access_mechanism import AbstractAccessMechanism
@dataclass
class GenericRegister(Register):
arch: str = "generic"
access_mechanisms: Dict[str, List[AbstractAccessMechan... | true | true |
1c381ca1d0bfb2bfa74bdb6df5fe4912de8c4e23 | 2,959 | py | Python | place_points_on_surface.py | shahpnmlab/cryoem-python | d0b27dc909c5538c3117c47f94504567db6d1ea5 | [
"MIT"
] | 1 | 2020-12-19T18:46:26.000Z | 2020-12-19T18:46:26.000Z | place_points_on_surface.py | shahpnmlab/cryoEM-Python | c4e317ba9563172c70ab4571ece0a2d322a301ff | [
"MIT"
] | null | null | null | place_points_on_surface.py | shahpnmlab/cryoEM-Python | c4e317ba9563172c70ab4571ece0a2d322a301ff | [
"MIT"
] | null | null | null | '''
This script will enable you to place points on the surface of an arbitary sphere
whose center is defined by marking the center of the sphere in IMOD and saving it as
mod file. In writing this script I used CR Drost's response to the question
of how do you evenly place points on the surface of sphere?
(https://stac... | 42.884058 | 113 | 0.709023 | import numpy as np
from numpy import pi, cos, sin, arccos, arange
import subprocess
import argparse
parser=argparse.ArgumentParser()
parser.add_argument("--i", help="IMOD mod file with centers of objects selected")
parser.add_argument("--r", help="The desired radius (px).",type=float)
parser.add_argument("--npts", he... | true | true |
1c381d53f3c3c4bcb97eda2c8cb51a65ba0f2a16 | 4,908 | py | Python | plgx-esp/polylogyx/plugins/logs/rsyslog.py | preetpoly/plgx-esp | ef03fbec2f875cc7a84db5eb2e0972c614747a9d | [
"MIT"
] | null | null | null | plgx-esp/polylogyx/plugins/logs/rsyslog.py | preetpoly/plgx-esp | ef03fbec2f875cc7a84db5eb2e0972c614747a9d | [
"MIT"
] | null | null | null | plgx-esp/polylogyx/plugins/logs/rsyslog.py | preetpoly/plgx-esp | ef03fbec2f875cc7a84db5eb2e0972c614747a9d | [
"MIT"
] | 1 | 2020-08-11T19:12:12.000Z | 2020-08-11T19:12:12.000Z | # -*- coding: utf-8 -*-
import datetime as dt
import socket
import json
from flask import current_app
from polylogyx.plugins import AbstractLogsPlugin
from polylogyx.utils import extract_results, quote, flatten_json, append_node_information_to_result_log, DateTimeEncoder
class RsyslogPlugin(AbstractLogsPlugin):
de... | 38.046512 | 161 | 0.515077 |
import datetime as dt
import socket
import json
from flask import current_app
from polylogyx.plugins import AbstractLogsPlugin
from polylogyx.utils import extract_results, quote, flatten_json, append_node_information_to_result_log, DateTimeEncoder
class RsyslogPlugin(AbstractLogsPlugin):
def __init__(self, config... | true | true |
1c381d558260e87b5f97b4cbaac3e1d11de2007c | 383 | py | Python | eslog/utils.py | wmariuss/eslog | c69173d9f1bb55aaf77e76188a0bf060f49f2d40 | [
"BSD-3-Clause"
] | 1 | 2020-09-30T15:21:02.000Z | 2020-09-30T15:21:02.000Z | eslog/utils.py | wmariuss/eslog | c69173d9f1bb55aaf77e76188a0bf060f49f2d40 | [
"BSD-3-Clause"
] | null | null | null | eslog/utils.py | wmariuss/eslog | c69173d9f1bb55aaf77e76188a0bf060f49f2d40 | [
"BSD-3-Clause"
] | null | null | null | import json
import pprint
from zipfile import ZipFile
def json_format(content):
"""Return text in JSON format"""
return json.loads(content)
def pretty(data):
"""Nice print"""
pp = pprint.PrettyPrinter(indent=2)
return pp.pprint(data)
def archive(file):
"""Archive file"""
with ZipFile("... | 18.238095 | 54 | 0.652742 | import json
import pprint
from zipfile import ZipFile
def json_format(content):
return json.loads(content)
def pretty(data):
pp = pprint.PrettyPrinter(indent=2)
return pp.pprint(data)
def archive(file):
with ZipFile("{}.zip".format(file), "w") as zipit:
zipit.write(file)
| true | true |
1c381d95a1622ec0b3b7cdee452d406f262bd735 | 7,316 | py | Python | produce_comparison_for_test.py | likedan/cp-vton | dde95aa0b3ede1e1c0e0b0a91ba94cf91ed1f79e | [
"MIT"
] | null | null | null | produce_comparison_for_test.py | likedan/cp-vton | dde95aa0b3ede1e1c0e0b0a91ba94cf91ed1f79e | [
"MIT"
] | null | null | null | produce_comparison_for_test.py | likedan/cp-vton | dde95aa0b3ede1e1c0e0b0a91ba94cf91ed1f79e | [
"MIT"
] | 1 | 2020-07-01T03:57:38.000Z | 2020-07-01T03:57:38.000Z | # coding=utf-8
import torch
import torch.nn as nn
import torch.nn.functional as F
import utils
import argparse
import os
from torchvision.utils import save_image
from cp_dataset import CPDataset, CPDataLoader
from networks import GMM, UnetGenerator, VGGLoss, load_checkpoint, save_checkpoint
from resnet import Embedder... | 40.41989 | 126 | 0.666348 |
import torch
import torch.nn as nn
import torch.nn.functional as F
import utils
import argparse
import os
from torchvision.utils import save_image
from cp_dataset import CPDataset, CPDataLoader
from networks import GMM, UnetGenerator, VGGLoss, load_checkpoint, save_checkpoint
from resnet import Embedder
from unet imp... | true | true |
1c381e03f0d781f75be5c7bbf816de0dc09d54b8 | 143 | py | Python | Sets/set.difference()_operation.py | aydinsimsek/HackerRank-solutions-python | ef4169fb9d1e4f0bf5de46bd09418e6aedfa6134 | [
"MIT"
] | null | null | null | Sets/set.difference()_operation.py | aydinsimsek/HackerRank-solutions-python | ef4169fb9d1e4f0bf5de46bd09418e6aedfa6134 | [
"MIT"
] | null | null | null | Sets/set.difference()_operation.py | aydinsimsek/HackerRank-solutions-python | ef4169fb9d1e4f0bf5de46bd09418e6aedfa6134 | [
"MIT"
] | null | null | null | n = int(input())
en = set(map(int, input().split()))
b = int(input())
fr = set(map(int, input().split()))
print(len(en.difference(fr)))
| 23.833333 | 37 | 0.573427 | n = int(input())
en = set(map(int, input().split()))
b = int(input())
fr = set(map(int, input().split()))
print(len(en.difference(fr)))
| true | true |
1c381e0e58d510c4c39c8cd8b4fb7ce56b415dee | 5,395 | py | Python | unet3d/generator_multiprocess.py | Pr0d19y/3DUnet-livers | 8b306b276228275c2f9df01c7b1468816dc1f332 | [
"MIT"
] | 6 | 2019-01-08T02:44:03.000Z | 2021-04-13T07:27:34.000Z | unet3d/generator_multiprocess.py | Pr0d19y/3DUnet-livers | 8b306b276228275c2f9df01c7b1468816dc1f332 | [
"MIT"
] | null | null | null | unet3d/generator_multiprocess.py | Pr0d19y/3DUnet-livers | 8b306b276228275c2f9df01c7b1468816dc1f332 | [
"MIT"
] | 1 | 2019-11-05T11:09:37.000Z | 2019-11-05T11:09:37.000Z | import keras
from keras.preprocessing.image import ImageDataGenerator
import numpy as np
from unet3d.data import open_data_file
import time
import gc
from multiprocessing import Pool
from functools import partial
from unet3d.generator import data_generator
from unet3d.generator import create_patch_index_list
import co... | 37.992958 | 143 | 0.660426 | import keras
from keras.preprocessing.image import ImageDataGenerator
import numpy as np
from unet3d.data import open_data_file
import time
import gc
from multiprocessing import Pool
from functools import partial
from unet3d.generator import data_generator
from unet3d.generator import create_patch_index_list
import co... | true | true |
1c381f6a9084179035025feb20906ae1aab51330 | 2,166 | py | Python | dockerfiles/rdpesr/add_RD_to_SVs.py | guoxueyu/gatk-sv | 22fc647dd3ee56a47cb0523ea8f6cc37c4b904eb | [
"BSD-3-Clause"
] | null | null | null | dockerfiles/rdpesr/add_RD_to_SVs.py | guoxueyu/gatk-sv | 22fc647dd3ee56a47cb0523ea8f6cc37c4b904eb | [
"BSD-3-Clause"
] | null | null | null | dockerfiles/rdpesr/add_RD_to_SVs.py | guoxueyu/gatk-sv | 22fc647dd3ee56a47cb0523ea8f6cc37c4b904eb | [
"BSD-3-Clause"
] | null | null | null | #script to add cov to SVs
def add_ILL_cov(pb_uni_svs,bincov):
for i in pb_uni_svs.keys():
for j in pb_uni_svs[i]:
cov_list=cov_SV_readin(j, bincov)
if len(cov_list)>0:
j+=[len(cov_list),np.median(cov_list), np.mean(... | 33.84375 | 106 | 0.537396 |
def add_ILL_cov(pb_uni_svs,bincov):
for i in pb_uni_svs.keys():
for j in pb_uni_svs[i]:
cov_list=cov_SV_readin(j, bincov)
if len(cov_list)>0:
j+=[len(cov_list),np.median(cov_list), np.mean(cov_list),np.std(cov_list... | true | true |
1c38217e0b61df6b7eff884266d12fc60cb0b73a | 1,261 | py | Python | src/Maze.py | Utsav-Patel/The-Imitation-Game | 09dfaffdf917c1adfb1d8cd3e09a216b9a014e52 | [
"MIT"
] | null | null | null | src/Maze.py | Utsav-Patel/The-Imitation-Game | 09dfaffdf917c1adfb1d8cd3e09a216b9a014e52 | [
"MIT"
] | null | null | null | src/Maze.py | Utsav-Patel/The-Imitation-Game | 09dfaffdf917c1adfb1d8cd3e09a216b9a014e52 | [
"MIT"
] | null | null | null | import numpy as np
from constants import UNVISITED_NUMBER
from src.Node import Node
class Maze:
def __init__(self, num_cols: int, num_rows: int):
self.num_cols = num_cols
self.num_rows = num_rows
self.maze_numpy = np.zeros((num_rows, num_cols)) + UNVISITED_NUMBER
self.num_times_c... | 32.333333 | 103 | 0.613006 | import numpy as np
from constants import UNVISITED_NUMBER
from src.Node import Node
class Maze:
def __init__(self, num_cols: int, num_rows: int):
self.num_cols = num_cols
self.num_rows = num_rows
self.maze_numpy = np.zeros((num_rows, num_cols)) + UNVISITED_NUMBER
self.num_times_c... | true | true |
1c3821ff5204a4bd0547f2cc0981f29b15959b35 | 3,649 | py | Python | backend/app/app/api/api_v1/endpoints/role.py | data-python/vue-element-admin-fastapi | 1ef2935bf18b6965f168d6091b7eabaded619b9b | [
"MIT"
] | 137 | 2020-08-06T17:00:50.000Z | 2022-03-28T02:38:23.000Z | backend/app/app/api/api_v1/endpoints/role.py | data-python/vue-element-admin-fastapi | 1ef2935bf18b6965f168d6091b7eabaded619b9b | [
"MIT"
] | 3 | 2020-08-16T14:32:38.000Z | 2021-02-07T11:31:06.000Z | backend/app/app/api/api_v1/endpoints/role.py | data-python/vue-element-admin-fastapi | 1ef2935bf18b6965f168d6091b7eabaded619b9b | [
"MIT"
] | 36 | 2020-08-07T01:34:22.000Z | 2022-03-31T04:55:41.000Z | from typing import Any
from fastapi import APIRouter, Depends
from sqlalchemy.orm import Session, joinedload
from app import models, schemas
from app.api import deps
from app.extensions.utils import list_to_tree, dfs_tree_to_list
router = APIRouter()
@router.get("/routes", response_model=schemas.Response)
def route... | 36.49 | 120 | 0.636339 | from typing import Any
from fastapi import APIRouter, Depends
from sqlalchemy.orm import Session, joinedload
from app import models, schemas
from app.api import deps
from app.extensions.utils import list_to_tree, dfs_tree_to_list
router = APIRouter()
@router.get("/routes", response_model=schemas.Response)
def route... | true | true |
1c3822b069ee64df66a75ee6dfa970295d128aba | 23,556 | py | Python | bl3save/cli_prof_edit.py | DataCluster0/wonderlands-cli-saveedit | 91c7cf30289d62b5d51963da39f80d85c8cb97c5 | [
"Zlib"
] | 78 | 2020-04-05T19:49:31.000Z | 2022-03-09T10:01:40.000Z | bl3save/cli_prof_edit.py | DataCluster0/wonderlands-cli-saveedit | 91c7cf30289d62b5d51963da39f80d85c8cb97c5 | [
"Zlib"
] | 24 | 2020-04-10T16:22:09.000Z | 2022-03-26T11:46:55.000Z | bl3save/cli_prof_edit.py | DataCluster0/wonderlands-cli-saveedit | 91c7cf30289d62b5d51963da39f80d85c8cb97c5 | [
"Zlib"
] | 19 | 2020-04-10T17:32:56.000Z | 2022-03-27T22:23:05.000Z | #!/usr/bin/env python3
# vim: set expandtab tabstop=4 shiftwidth=4:
# Copyright (c) 2020-2021 CJ Kucera (cj@apocalyptech.com)
#
# This software is provided 'as-is', without any express or implied warranty.
# In no event will the authors be held liable for any damages arising from
# the use of this software.
#
# Perm... | 38.616393 | 124 | 0.598022 |
import os
import sys
import bl3save
import argparse
from . import cli_common
from bl3save.bl3profile import BL3Profile
def main():
parser = argparse.ArgumentParser(
description='Borderlands 3 CLI Profile Editor v{} (PC Only)'.format(bl3save.__version__),
formatt... | true | true |
1c3822d343c152c3c84298afdba5a208cab24a5a | 62,879 | py | Python | src/pretix/api/serializers/order.py | fakegit/pretix | b6e9e64ff967f7b4f91fe88694f4157d8a0787b4 | [
"Apache-2.0"
] | null | null | null | src/pretix/api/serializers/order.py | fakegit/pretix | b6e9e64ff967f7b4f91fe88694f4157d8a0787b4 | [
"Apache-2.0"
] | 56 | 2020-05-07T07:54:17.000Z | 2021-04-19T12:14:14.000Z | src/pretix/api/serializers/order.py | fakegit/pretix | b6e9e64ff967f7b4f91fe88694f4157d8a0787b4 | [
"Apache-2.0"
] | null | null | null | #
# This file is part of pretix (Community Edition).
#
# Copyright (C) 2014-2020 Raphael Michel and contributors
# Copyright (C) 2020-2021 rami.io GmbH and contributors
#
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
# Public License as published by ... | 43.63567 | 160 | 0.571908 |
import json
from collections import Counter, defaultdict
from decimal import Decimal
import pycountry
from django.core.files import File
from django.db.models import F, Q
from django.utils.timezone import now
from django.utils.translation import gettext_lazy
from django_countries.fields import Cou... | true | true |
1c3822e9820d11b876c263fd47b55ca874718491 | 876 | py | Python | tinypipe/utils/general.py | dave-msk/tinypipe | 0be1c3cafb2a1cb2f672e4688e84889fa52dad30 | [
"Apache-2.0"
] | null | null | null | tinypipe/utils/general.py | dave-msk/tinypipe | 0be1c3cafb2a1cb2f672e4688e84889fa52dad30 | [
"Apache-2.0"
] | null | null | null | tinypipe/utils/general.py | dave-msk/tinypipe | 0be1c3cafb2a1cb2f672e4688e84889fa52dad30 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Siu-Kei Muk (David). 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... | 39.818182 | 80 | 0.705479 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
def val_or_default(val, default):
return val if val is not None else default
| true | true |
1c3823c76dbf00f9fce4c4498a7bed366e31e3ef | 90 | py | Python | cms/__init__.py | fp4code/django-cms | e382fc7fe039733fee187658066a7b4af656c49e | [
"BSD-3-Clause"
] | 1 | 2019-09-14T09:45:12.000Z | 2019-09-14T09:45:12.000Z | cms/__init__.py | zahedbri/django-cms | 70c11c90d14459ef63472f3d0e6c90086c6098c5 | [
"BSD-3-Clause"
] | null | null | null | cms/__init__.py | zahedbri/django-cms | 70c11c90d14459ef63472f3d0e6c90086c6098c5 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
__version__ = '3.4.5'
default_app_config = 'cms.apps.CMSConfig'
| 15 | 41 | 0.644444 |
__version__ = '3.4.5'
default_app_config = 'cms.apps.CMSConfig'
| true | true |
1c3823cc1f57943e9f990aa7d2ac42167d0e0e23 | 4,779 | py | Python | composition_root.py | plievana/python-ddd | 44b1932344260b33ee0cce538c0be0b56b21327d | [
"MIT"
] | null | null | null | composition_root.py | plievana/python-ddd | 44b1932344260b33ee0cce538c0be0b56b21327d | [
"MIT"
] | null | null | null | composition_root.py | plievana/python-ddd | 44b1932344260b33ee0cce538c0be0b56b21327d | [
"MIT"
] | null | null | null | import dependency_injector.containers as containers
import dependency_injector.providers as providers
from application.command_bus import CommandBus
from application.command_handlers import AddItemCommandHandler
from application.query_bus import QueryBus
from application.query_handlers import GetItemsQueryHandler
from... | 51.387097 | 162 | 0.642394 | import dependency_injector.containers as containers
import dependency_injector.providers as providers
from application.command_bus import CommandBus
from application.command_handlers import AddItemCommandHandler
from application.query_bus import QueryBus
from application.query_handlers import GetItemsQueryHandler
from... | true | true |
1c3823cef3b0698023be0f415936f0db8a9d85de | 2,198 | py | Python | qpricesim/model_code/economic_environment.py | ToFeWe/qpricesim | 2d4312ed1d1356449f0c168835a0662b238a27bb | [
"MIT"
] | 2 | 2022-03-22T12:16:37.000Z | 2022-03-22T12:48:46.000Z | qpricesim/model_code/economic_environment.py | ToFeWe/qpricesim | 2d4312ed1d1356449f0c168835a0662b238a27bb | [
"MIT"
] | null | null | null | qpricesim/model_code/economic_environment.py | ToFeWe/qpricesim | 2d4312ed1d1356449f0c168835a0662b238a27bb | [
"MIT"
] | null | null | null | """
A module that defines the economic environment the agents are interacting in.
"""
import numpy as np
from numba import njit
@njit
def calc_winning_price(all_prices):
"""
Helper function that takes in the array of all prices in the market
and returns the winning price and the number of firms that pick... | 32.80597 | 86 | 0.696087 | import numpy as np
from numba import njit
@njit
def calc_winning_price(all_prices):
winning_price = np.min(all_prices)
n_winning_price = np.sum(np.where(all_prices == winning_price, 1, 0))
return winning_price, n_winning_price
@njit
def calc_reward(p_i, winning_price, n_winning_price, re... | true | true |
1c3824dda1e45856c1c591405392e5f8ca1dd8b1 | 8,686 | py | Python | dosna/backends/s3.py | ijjorama/DosNa | 8e5322a0e1b93a377a9a443d442253b45957dac2 | [
"Apache-2.0"
] | null | null | null | dosna/backends/s3.py | ijjorama/DosNa | 8e5322a0e1b93a377a9a443d442253b45957dac2 | [
"Apache-2.0"
] | null | null | null | dosna/backends/s3.py | ijjorama/DosNa | 8e5322a0e1b93a377a9a443d442253b45957dac2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Backend s3 uses a S3 interface to store the dataset and chunks data"""
import logging
import numpy as np
import boto3
from botocore.exceptions import ClientError
from dosna.backends import Backend
from dosna.backends.base import (BackendConnection, BackendDataChunk,
... | 29.544218 | 79 | 0.590145 |
import logging
import numpy as np
import boto3
from botocore.exceptions import ClientError
from dosna.backends import Backend
from dosna.backends.base import (BackendConnection, BackendDataChunk,
BackendDataset, ConnectionError,
DatasetNotFoundError)... | true | true |
1c3825a7c22eda2611ef396149cf33214f4ab6ae | 8,509 | py | Python | benchmarks/f3_wrong_hints_permutations/scaling_software_termination/18-2Nested_false-termination_5.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 3 | 2021-04-23T23:29:26.000Z | 2022-03-23T10:00:30.000Z | benchmarks/f3_wrong_hints_permutations/scaling_software_termination/18-2Nested_false-termination_5.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | null | null | null | benchmarks/f3_wrong_hints_permutations/scaling_software_termination/18-2Nested_false-termination_5.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 1 | 2021-11-17T22:02:56.000Z | 2021-11-17T22:02:56.000Z | from typing import Tuple, FrozenSet
from pysmt.environment import Environment as PysmtEnv
from pysmt.fnode import FNode
import pysmt.typing as types
from utils import symb_to_next
from hint import Hint, Location
def transition_system(env: PysmtEnv) -> Tuple[FrozenSet[FNode], FNode, FNode,
... | 31.75 | 77 | 0.590786 | from typing import Tuple, FrozenSet
from pysmt.environment import Environment as PysmtEnv
from pysmt.fnode import FNode
import pysmt.typing as types
from utils import symb_to_next
from hint import Hint, Location
def transition_system(env: PysmtEnv) -> Tuple[FrozenSet[FNode], FNode, FNode,
... | true | true |
1c38271b2f5390e82710ce248c2a449c33d2bc3e | 1,659 | py | Python | src/genie/libs/parser/iosxe/tests/ShowLispInstanceIdIpv4MapCache/cli/equal/golden_output6_metric_expected.py | nielsvanhooy/genieparser | 9a1955749697a6777ca614f0af4d5f3a2c254ccd | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/iosxe/tests/ShowLispInstanceIdIpv4MapCache/cli/equal/golden_output6_metric_expected.py | nielsvanhooy/genieparser | 9a1955749697a6777ca614f0af4d5f3a2c254ccd | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/iosxe/tests/ShowLispInstanceIdIpv4MapCache/cli/equal/golden_output6_metric_expected.py | nielsvanhooy/genieparser | 9a1955749697a6777ca614f0af4d5f3a2c254ccd | [
"Apache-2.0"
] | null | null | null | expected_output = {
'lisp_id': {
0: {
'instance_id': {
111: {
'eid_prefix': {
'0.0.0.0/0': {
'action': 'send-map-request + Encapsulating to proxy ETR',
'expiry_time': '00:1... | 41.475 | 87 | 0.221218 | expected_output = {
'lisp_id': {
0: {
'instance_id': {
111: {
'eid_prefix': {
'0.0.0.0/0': {
'action': 'send-map-request + Encapsulating to proxy ETR',
'expiry_time': '00:1... | true | true |
1c382759860b98ee6972f4f10fd270f3d5268410 | 665 | py | Python | nnabla_nas/optimizer/__init__.py | sony/nnabla-nas | 269deb8229fda0f0901c47d21ac5ce244f403f63 | [
"Apache-2.0"
] | 16 | 2020-07-10T08:31:18.000Z | 2022-03-24T13:28:15.000Z | nnabla_nas/optimizer/__init__.py | sony/nnabla-nas | 269deb8229fda0f0901c47d21ac5ce244f403f63 | [
"Apache-2.0"
] | 1 | 2020-10-21T12:46:30.000Z | 2021-02-03T00:18:29.000Z | nnabla_nas/optimizer/__init__.py | sony/nnabla-nas | 269deb8229fda0f0901c47d21ac5ce244f403f63 | [
"Apache-2.0"
] | 3 | 2020-07-15T11:42:11.000Z | 2022-03-25T16:54:49.000Z | # Copyright (c) 2020 Sony Corporation. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 36.944444 | 74 | 0.760902 |
from .optimizer import Optimizer
__all__ = ['Optimizer']
| true | true |
1c382788882dfc7e712f0027de33754dbb491241 | 3,234 | py | Python | src/DanceCV.py | stbnps/DanceCV | ac94f5f715c246a50f67f99abbe926a7461fba11 | [
"BSD-3-Clause"
] | 33 | 2015-01-02T08:14:39.000Z | 2021-12-08T16:13:12.000Z | src/DanceCV.py | stbnps/DanceCV | ac94f5f715c246a50f67f99abbe926a7461fba11 | [
"BSD-3-Clause"
] | 2 | 2018-03-03T09:18:58.000Z | 2020-06-29T08:25:20.000Z | src/DanceCV.py | stbnps/DanceCV | ac94f5f715c246a50f67f99abbe926a7461fba11 | [
"BSD-3-Clause"
] | 17 | 2015-11-22T03:42:59.000Z | 2021-11-18T13:05:05.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Copyright (c) 2014, Esteban Pardo Sánchez
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyri... | 34.404255 | 83 | 0.683055 |
from Resource import Resource
from Audio import Audio
from Scene import Scene
from Song import Song, Note, loadSong
from Input import Input
import pygame
from pygame.locals import *
import sys
import getopt
import Constants
class DanceCV():
def __init__(self, song, speed):
self.input = Input()
... | true | true |
1c3828893b4eae531bd9c2811241ec3653b28a34 | 4,349 | tac | Python | mailmynet/Maildir/proxy_postfix/Twisted-11.0.0/doc/core/howto/tutorial/listings/finger/finger18.tac | SPIN-UMass/SWEET | 1b0f39222e7064f70812e3293ca023619295741d | [
"MIT"
] | 3 | 2020-04-02T06:23:44.000Z | 2020-08-13T20:32:31.000Z | mailmynet/Maildir/proxy_postfix/Twisted-11.0.0/doc/core/howto/tutorial/listings/finger/finger18.tac | SPIN-UMass/SWEET | 1b0f39222e7064f70812e3293ca023619295741d | [
"MIT"
] | null | null | null | mailmynet/Maildir/proxy_postfix/Twisted-11.0.0/doc/core/howto/tutorial/listings/finger/finger18.tac | SPIN-UMass/SWEET | 1b0f39222e7064f70812e3293ca023619295741d | [
"MIT"
] | 1 | 2020-04-02T06:26:10.000Z | 2020-04-02T06:26:10.000Z | # Do everything properly
from twisted.application import internet, service
from twisted.internet import protocol, reactor, defer
from twisted.words.protocols import irc
from twisted.protocols import basic
from twisted.web import resource, server, static, xmlrpc
import cgi
def catchError(err):
return "Internal erro... | 29.585034 | 69 | 0.627271 |
from twisted.application import internet, service
from twisted.internet import protocol, reactor, defer
from twisted.words.protocols import irc
from twisted.protocols import basic
from twisted.web import resource, server, static, xmlrpc
import cgi
def catchError(err):
return "Internal error in server"
class Fin... | true | true |
1c3828ea6b5762a786575e6a8677fcca9f43fee1 | 3,220 | py | Python | app/db/__init__.py | MoeZilla/BlueMoonVampireBot | af074f846b56e7a4f262740d7b65b32ab11a4e42 | [
"MIT"
] | 1 | 2022-01-25T06:28:51.000Z | 2022-01-25T06:28:51.000Z | app/db/__init__.py | MoeZilla/BlueMoonVampireBot | af074f846b56e7a4f262740d7b65b32ab11a4e42 | [
"MIT"
] | null | null | null | app/db/__init__.py | MoeZilla/BlueMoonVampireBot | af074f846b56e7a4f262740d7b65b32ab11a4e42 | [
"MIT"
] | null | null | null | """
MIT License
Copyright (C) 2021-2022, NkSama
Copyright (C) 2021-2022 Moezilla
Copyright (c) 2021, Sylviorus, <https://github.com/Sylviorus/BlueMoonVampireBot>
This file is part of @BlueMoonVampireBot (Antispam Telegram Bot)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software... | 33.195876 | 80 | 0.614907 |
import json
from operator import index
from re import S
from pymongo import MongoClient
import os
class DATABASE:
def __init__(self, db_url) -> None:
self.db_url = db_url
self.role_db = MongoClient(self.db_url)['Sylviorus']['CUSTOM_ROLES']
def already_exists(self, user_id):
x = self... | true | true |
1c38290c557a6708c9109fea74a5db7debcf6324 | 3,521 | py | Python | school/models.py | ntwaliandy/school-system | 93b81f62a21ae477ac524a99d2fbb6f16ef2efae | [
"MIT"
] | null | null | null | school/models.py | ntwaliandy/school-system | 93b81f62a21ae477ac524a99d2fbb6f16ef2efae | [
"MIT"
] | null | null | null | school/models.py | ntwaliandy/school-system | 93b81f62a21ae477ac524a99d2fbb6f16ef2efae | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class TeacherExtra(models.Model):
user=models.OneToOneField(User,on_delete=models.CASCADE)
salary = models.PositiveIntegerField(null=False)
joindate=models.DateField(auto_now_add=True)
mobile = models.C... | 36.298969 | 112 | 0.703777 | from django.db import models
from django.contrib.auth.models import User
class TeacherExtra(models.Model):
user=models.OneToOneField(User,on_delete=models.CASCADE)
salary = models.PositiveIntegerField(null=False)
joindate=models.DateField(auto_now_add=True)
mobile = models.CharField(max_length=40)
... | true | true |
1c38298251177b9e862ba52d259770df7599f35e | 11,130 | py | Python | tests/func/test_scm.py | lucasalavapena/dvc | 230eb7087df7f063ded7422af7ae45bd04eb794a | [
"Apache-2.0"
] | null | null | null | tests/func/test_scm.py | lucasalavapena/dvc | 230eb7087df7f063ded7422af7ae45bd04eb794a | [
"Apache-2.0"
] | 87 | 2021-04-27T08:17:31.000Z | 2022-03-30T12:12:40.000Z | tests/func/test_scm.py | lucasalavapena/dvc | 230eb7087df7f063ded7422af7ae45bd04eb794a | [
"Apache-2.0"
] | null | null | null | import os
import sys
import pytest
from git import Repo
from dvc.scm import SCM, Git, NoSCM
from dvc.scm.base import SCMError
from dvc.system import System
from tests.basic_env import TestGitSubmodule
from tests.utils import get_gitignore_content
def test_init_none(tmp_dir):
assert isinstance(SCM(os.fspath(tmp_... | 29.060052 | 79 | 0.637556 | import os
import sys
import pytest
from git import Repo
from dvc.scm import SCM, Git, NoSCM
from dvc.scm.base import SCMError
from dvc.system import System
from tests.basic_env import TestGitSubmodule
from tests.utils import get_gitignore_content
def test_init_none(tmp_dir):
assert isinstance(SCM(os.fspath(tmp_... | true | true |
1c382bdec7b3a619d5432493cd7bf74eed54be9e | 1,236 | py | Python | src/ikea_api/endpoints/search.py | RCRalph/ikea-api-client | 51c71bfc423d0b995f60add11837d7860d14f754 | [
"MIT"
] | null | null | null | src/ikea_api/endpoints/search.py | RCRalph/ikea-api-client | 51c71bfc423d0b995f60add11837d7860d14f754 | [
"MIT"
] | null | null | null | src/ikea_api/endpoints/search.py | RCRalph/ikea-api-client | 51c71bfc423d0b995f60add11837d7860d14f754 | [
"MIT"
] | null | null | null | from __future__ import annotations
from typing import Any, Literal
from ikea_api.abc import Endpoint, SessionInfo, endpoint
from ikea_api.base_ikea_api import BaseIkeaAPI
from ikea_api.error_handlers import handle_json_decode_error
SearchType = Literal["PRODUCT", "CONTENT", "PLANNER", "REFINED_SEARCHES", "ANSWER"]
... | 34.333333 | 116 | 0.631877 | from __future__ import annotations
from typing import Any, Literal
from ikea_api.abc import Endpoint, SessionInfo, endpoint
from ikea_api.base_ikea_api import BaseIkeaAPI
from ikea_api.error_handlers import handle_json_decode_error
SearchType = Literal["PRODUCT", "CONTENT", "PLANNER", "REFINED_SEARCHES", "ANSWER"]
... | true | true |
1c382c4356470aefb4f62003845ae4e4c6777f19 | 1,608 | py | Python | CFM_main/reader.py | michaelleerilee/CommunityFirnModel | 312fc30b62b7e36a609660e5b10e3269eb090bae | [
"MIT"
] | null | null | null | CFM_main/reader.py | michaelleerilee/CommunityFirnModel | 312fc30b62b7e36a609660e5b10e3269eb090bae | [
"MIT"
] | null | null | null | CFM_main/reader.py | michaelleerilee/CommunityFirnModel | 312fc30b62b7e36a609660e5b10e3269eb090bae | [
"MIT"
] | null | null | null | #!usr/bin/env python
'''
Functions to read model inputs.
'''
import os
import numpy as np
# from string import join
from constants import *
import h5py
def read_input(filename,StartDate=None):
'''
Read in data from csv input files
:param filename: name of the file which holds the accumulation rate data
... | 26.8 | 114 | 0.659204 |
import os
import numpy as np
from constants import *
import h5py
def read_input(filename,StartDate=None):
spot = os.getcwd()
FID = os.path.join(spot, filename)
data = np.loadtxt(FID, delimiter=',')
xx,yy = np.shape(data)
if xx>yy:
input_year = data[:, 0]
input_dat... | true | true |
1c382cadea0a62ded77480b47a1fb27b85d96974 | 12,384 | py | Python | third_party/html5lib/tests/test_treewalkers.py | dewitt/appengine-unshorten | 1bb9e277eb67cefbf176b104d3297da5402e67b7 | [
"Apache-2.0"
] | 1 | 2020-09-03T23:55:06.000Z | 2020-09-03T23:55:06.000Z | third_party/html5lib/tests/test_treewalkers.py | dewitt/appengine-unshorten | 1bb9e277eb67cefbf176b104d3297da5402e67b7 | [
"Apache-2.0"
] | null | null | null | third_party/html5lib/tests/test_treewalkers.py | dewitt/appengine-unshorten | 1bb9e277eb67cefbf176b104d3297da5402e67b7 | [
"Apache-2.0"
] | null | null | null | import os
import sys
import StringIO
import unittest
import warnings
warnings.simplefilter("error")
from support import html5lib_test_files, TestData, convertExpected
from html5lib import html5parser, treewalkers, treebuilders, constants
from html5lib.filters.lint import Filter as LintFilter, LintError
def PullDOMA... | 38.222222 | 87 | 0.537791 | import os
import sys
import StringIO
import unittest
import warnings
warnings.simplefilter("error")
from support import html5lib_test_files, TestData, convertExpected
from html5lib import html5parser, treewalkers, treebuilders, constants
from html5lib.filters.lint import Filter as LintFilter, LintError
def PullDOMA... | true | true |
1c382cbe929885479c5aacb20d6f2814d53176b1 | 10,360 | py | Python | rnn-gru-random/train.py | manashpratim/Classification-of-Song-Attributes-using-Lyrics | 801b7d45bd98f3edbb4219d7e947a1bd20ec206c | [
"MIT"
] | 1 | 2020-01-17T03:05:48.000Z | 2020-01-17T03:05:48.000Z | rnn-gru-random/train.py | manashpratim/Classification-of-Song-Attributes-using-Lyrics | 801b7d45bd98f3edbb4219d7e947a1bd20ec206c | [
"MIT"
] | null | null | null | rnn-gru-random/train.py | manashpratim/Classification-of-Song-Attributes-using-Lyrics | 801b7d45bd98f3edbb4219d7e947a1bd20ec206c | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
import os,sys
import datetime
import time
from rnn import RNN
import data_helpers
# Parameters
# ==================================================
did = sys.argv[1]
f1 = open("log_{}".format(did),"w")
# Data loading params
tf.flags.DEFINE_string("pos_dir", "data/rt-polarityd... | 48.867925 | 122 | 0.597587 | import tensorflow as tf
import numpy as np
import os,sys
import datetime
import time
from rnn import RNN
import data_helpers
did = sys.argv[1]
f1 = open("log_{}".format(did),"w")
tf.flags.DEFINE_string("pos_dir", "data/rt-polaritydata/rt-polarity.pos", "Path of positive data")
tf.flags.DEFINE_string("neg_dir", "dat... | true | true |
1c382d2b8800ba69f78fa9e0859b7d4c992c4f1e | 4,842 | py | Python | earth_enterprise/src/server/wsgi/serve/constants.py | jsuberza/earthenterprise | e661a41f7cc218c60b269b0c9911df928cd9ce12 | [
"Apache-2.0"
] | 1 | 2020-06-17T12:20:52.000Z | 2020-06-17T12:20:52.000Z | earth_enterprise/src/server/wsgi/serve/constants.py | jsuberza/earthenterprise | e661a41f7cc218c60b269b0c9911df928cd9ce12 | [
"Apache-2.0"
] | null | null | null | earth_enterprise/src/server/wsgi/serve/constants.py | jsuberza/earthenterprise | e661a41f7cc218c60b269b0c9911df928cd9ce12 | [
"Apache-2.0"
] | 1 | 2020-12-16T09:26:10.000Z | 2020-12-16T09:26:10.000Z | #!/usr/bin/python
#
# Copyright 2017 Google 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 a... | 31.855263 | 79 | 0.803594 |
MULTI_PART_PARAMETER_DELIMITER = ","
POI_SEARCH_SERVICE_NAME = "POISearch"
DEFAULT_SEARCH_SERVICE_NAME = "GeocodingFederated"
HOST_NAME = "Host"
CMD = "Cmd"
CMD_PING = "Ping"
CMD_RESET = "Reset"
CMD_QUERY = "Query"
CMD_ADD_DB = "AddDb"
CMD_DELETE_DB = "DeleteDb"
CMD_CLEANUP_DB = "CleanupDb"
CMD_PU... | true | true |
1c382f14053fc6ec2c7e73bebc1a8bdd0037777f | 333 | py | Python | scripts/5.2.plot_stability.py | nmningmei/agent_models | 8380f1203e6d5a18f18f9adeb6bd36b23b2ae61b | [
"MIT"
] | null | null | null | scripts/5.2.plot_stability.py | nmningmei/agent_models | 8380f1203e6d5a18f18f9adeb6bd36b23b2ae61b | [
"MIT"
] | null | null | null | scripts/5.2.plot_stability.py | nmningmei/agent_models | 8380f1203e6d5a18f18f9adeb6bd36b23b2ae61b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 29 08:37:19 2020
@author: nmei
"""
import os
import gc
from glob import glob
from tqdm import tqdm
import numpy as np
import pandas as pd
import seaborn as sns
working_dir = '../stability'
working_data = glob(os.path.join(working_dir,'*','stabil... | 15.136364 | 67 | 0.6997 |
import os
import gc
from glob import glob
from tqdm import tqdm
import numpy as np
import pandas as pd
import seaborn as sns
working_dir = '../stability'
working_data = glob(os.path.join(working_dir,'*','stability*.npy'))
| true | true |
1c382f9eb7b88a9524ab2bb8a7334e5fa289e7f2 | 3,001 | py | Python | vim/choices/letter.py | GoNZooo/dragonfly-grammars | 22d639d8f86f4f5a7c44caa73e75c4938c0ce199 | [
"MIT"
] | 3 | 2020-09-06T10:40:19.000Z | 2020-09-29T20:39:52.000Z | vim/choices/letter.py | GoNZooo/dragonfly-grammars | 22d639d8f86f4f5a7c44caa73e75c4938c0ce199 | [
"MIT"
] | null | null | null | vim/choices/letter.py | GoNZooo/dragonfly-grammars | 22d639d8f86f4f5a7c44caa73e75c4938c0ce199 | [
"MIT"
] | null | null | null | from dragonfly import (Choice)
def letter_choice(name="letter"):
return Choice(name, {
'air': 'a',
'bat': 'b',
'cap': 'c',
'drum': 'd',
'each': 'e',
'fine': 'f',
'gust': 'g',
'harp': 'h',
'sit': 'i',
'jim': 'j',
'kick': 'k',
... | 22.22963 | 49 | 0.377541 | from dragonfly import (Choice)
def letter_choice(name="letter"):
return Choice(name, {
'air': 'a',
'bat': 'b',
'cap': 'c',
'drum': 'd',
'each': 'e',
'fine': 'f',
'gust': 'g',
'harp': 'h',
'sit': 'i',
'jim': 'j',
'kick': 'k',
... | true | true |
1c38306c2d00deac55934d2428e42f226f59dead | 1,096 | py | Python | app/app/urls.py | gbr-mendes/ead-courses-api | fd0fcc8aef996c4b671f34d51a8a74aafdf78480 | [
"MIT"
] | 1 | 2022-01-31T18:12:42.000Z | 2022-01-31T18:12:42.000Z | app/app/urls.py | gbr-mendes/ead-courses-api | fd0fcc8aef996c4b671f34d51a8a74aafdf78480 | [
"MIT"
] | null | null | null | app/app/urls.py | gbr-mendes/ead-courses-api | fd0fcc8aef996c4b671f34d51a8a74aafdf78480 | [
"MIT"
] | null | null | null | """app URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based vie... | 36.533333 | 90 | 0.69708 | from django.contrib import admin
from django.urls import path, include
from university import views
urlpatterns = [
path('admin/', admin.site.urls),
path('api-auth/', include('rest_framework.urls')),
path('', views.ExibitionView.as_view(), name='home_message'),# apresatation of project
p... | true | true |
1c3830931ecef6f54d56e54465037878caf81142 | 8,102 | py | Python | spatial_reasoning/models/uvfa_text.py | MarcCote/spatial-reasoning | 06c57cfafbd1c24b68d6ab634d19806964d867f3 | [
"MIT"
] | null | null | null | spatial_reasoning/models/uvfa_text.py | MarcCote/spatial-reasoning | 06c57cfafbd1c24b68d6ab634d19806964d867f3 | [
"MIT"
] | null | null | null | spatial_reasoning/models/uvfa_text.py | MarcCote/spatial-reasoning | 06c57cfafbd1c24b68d6ab634d19806964d867f3 | [
"MIT"
] | null | null | null | ## predicts entire value map
## rather than a single value
import torch
import math, torch.nn as nn, pdb
import torch.nn.functional as F
from torch.autograd import Variable
import spatial_reasoning.models as models
import spatial_reasoning.utils as utils
class UVFA_text(nn.Module):
def __init__(self, lstm, state_... | 36.169643 | 111 | 0.620464 | torch.nn.functional as F
from torch.autograd import Variable
import spatial_reasoning.models as models
import spatial_reasoning.utils as utils
class UVFA_text(nn.Module):
def __init__(self, lstm, state_vocab, object_vocab, args, map_dim = 10, batch_size = 32):
super(UVFA_text, self).__init__()
se... | true | true |
1c383171fd75508cefec057633d20ca9a2f06f7e | 8,220 | py | Python | bzt/modules/java/tools.py | YajanaRao/taurus | c08e5b90063bf4f7904e8ec4eb5f3c50a8e89ac0 | [
"Apache-2.0"
] | null | null | null | bzt/modules/java/tools.py | YajanaRao/taurus | c08e5b90063bf4f7904e8ec4eb5f3c50a8e89ac0 | [
"Apache-2.0"
] | null | null | null | bzt/modules/java/tools.py | YajanaRao/taurus | c08e5b90063bf4f7904e8ec4eb5f3c50a8e89ac0 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2018 BlazeMeter 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 writing, software... | 36.533333 | 112 | 0.693309 | import re
import subprocess
from bzt import ToolError
from bzt.utils import shell_exec, sync_run, RequiredTool, parse_java_version
class JarTool(RequiredTool):
VERSION = ""
URL = "{remote_addr}{remote_path}"
REMOTE_ADDR = "http://search.maven.org/remotecontent?filepath="
REMOTE_PATH = ""
LOCAL_PA... | true | true |
1c383228303b44befe4c767af4340793fe11954c | 7,109 | py | Python | chemfiles/trajectory.py | chemfiles/Chemharp.py | 45b8a02b7a0f07d6dcafa52db39df6a39f6f496c | [
"BSD-3-Clause"
] | 2 | 2019-04-17T11:13:13.000Z | 2021-04-28T20:34:49.000Z | chemfiles/trajectory.py | chemfiles/Chemharp.py | 45b8a02b7a0f07d6dcafa52db39df6a39f6f496c | [
"BSD-3-Clause"
] | 15 | 2016-02-19T21:51:33.000Z | 2021-07-21T09:01:52.000Z | chemfiles/trajectory.py | chemfiles/Chemharp.py | 45b8a02b7a0f07d6dcafa52db39df6a39f6f496c | [
"BSD-3-Clause"
] | 3 | 2020-06-16T08:41:24.000Z | 2021-07-22T14:51:33.000Z | # -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from ctypes import c_uint64, c_char_p
import sys
from .utils import CxxPointer, _call_with_growing_buffer
from .frame import Frame, Topology
from .misc import ChemfilesError
# Python 2 compatibility
if sys.hexversion >= 0x... | 32.760369 | 87 | 0.60965 |
from __future__ import absolute_import, print_function, unicode_literals
from ctypes import c_uint64, c_char_p
import sys
from .utils import CxxPointer, _call_with_growing_buffer
from .frame import Frame, Topology
from .misc import ChemfilesError
if sys.hexversion >= 0x03000000:
unicode_string = str
bytes_s... | true | true |
1c38332477ade3863d6275a24700253942626083 | 29,157 | py | Python | core/domain/collection_domain_test.py | alexewu/oppia | 57c3c660ab7974835ec068d7c7f5ce5b5f1f25ae | [
"Apache-2.0"
] | null | null | null | core/domain/collection_domain_test.py | alexewu/oppia | 57c3c660ab7974835ec068d7c7f5ce5b5f1f25ae | [
"Apache-2.0"
] | null | null | null | core/domain/collection_domain_test.py | alexewu/oppia | 57c3c660ab7974835ec068d7c7f5ce5b5f1f25ae | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2015 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 36.629397 | 79 | 0.673732 |
from core.domain import collection_domain
from core.domain import collection_services
from core.tests import test_utils
import feconf
import utils
SAMPLE_YAML_CONTENT = ("""category: A category
language_code: en
nodes:
- exploration_id: an_exploration_id
objective: An objective
schema_version: ... | true | true |
1c3833377ac441e8cf3d5885d193dc72b8a361ad | 64 | py | Python | bokeh_metaplot/__init__.py | doomsplayer/bokeh-metaplot | e5f74017a6ed6c60b6a37a87a071ea54ab882f9c | [
"MIT"
] | null | null | null | bokeh_metaplot/__init__.py | doomsplayer/bokeh-metaplot | e5f74017a6ed6c60b6a37a87a071ea54ab882f9c | [
"MIT"
] | null | null | null | bokeh_metaplot/__init__.py | doomsplayer/bokeh-metaplot | e5f74017a6ed6c60b6a37a87a071ea54ab882f9c | [
"MIT"
] | null | null | null | from .metaplot import MetaPlot, MetaChart, MetaFigure, metaize
| 21.333333 | 62 | 0.8125 | from .metaplot import MetaPlot, MetaChart, MetaFigure, metaize
| true | true |
1c38333a94e6ed4e43e327d6343bda2f1d029216 | 10,159 | py | Python | prompt_toolkit/input/vt100.py | mark64/python-prompt-toolkit | df768003df167382f3a11a73d800a4555ca1157c | [
"BSD-3-Clause"
] | 2 | 2020-05-29T17:51:10.000Z | 2020-05-29T17:52:26.000Z | prompt_toolkit/input/vt100.py | vxgmichel/python-prompt-toolkit | a49c486fa5ae6ad5a38ff3c1050f9c9609acac1d | [
"BSD-3-Clause"
] | null | null | null | prompt_toolkit/input/vt100.py | vxgmichel/python-prompt-toolkit | a49c486fa5ae6ad5a38ff3c1050f9c9609acac1d | [
"BSD-3-Clause"
] | null | null | null | import contextlib
import io
import os
import sys
import termios
import tty
from asyncio import AbstractEventLoop, get_event_loop
from typing import (
Callable,
ContextManager,
Dict,
Generator,
List,
Optional,
Set,
TextIO,
Tuple,
Union,
)
from prompt_toolkit.utils import is_dumb_... | 32.353503 | 87 | 0.617974 | import contextlib
import io
import os
import sys
import termios
import tty
from asyncio import AbstractEventLoop, get_event_loop
from typing import (
Callable,
ContextManager,
Dict,
Generator,
List,
Optional,
Set,
TextIO,
Tuple,
Union,
)
from prompt_toolkit.utils import is_dumb_... | true | true |
1c3833a131a1ebfe57e0a4626e989e801f84a185 | 480 | py | Python | pdf_first_page_to_jpg.py | Pakequis/Python_scripts | b0de2e2647ecaed331e7f8df2422b548df4b348c | [
"MIT"
] | null | null | null | pdf_first_page_to_jpg.py | Pakequis/Python_scripts | b0de2e2647ecaed331e7f8df2422b548df4b348c | [
"MIT"
] | null | null | null | pdf_first_page_to_jpg.py | Pakequis/Python_scripts | b0de2e2647ecaed331e7f8df2422b548df4b348c | [
"MIT"
] | null | null | null | # Library: pdf2image and poppler-0.68.0
import os
from pdf2image import convert_from_path
pdf_dir = "PATH" #Path to the pdf folder
os.chdir(pdf_dir)
print("PDF to image start...")
for pdf_file in os.listdir(pdf_dir):
if pdf_file.endswith(".pdf"):
pages = convert_from_path(pdf_file, 150,None,1,1) #seco... | 22.857143 | 95 | 0.66875 |
import os
from pdf2image import convert_from_path
pdf_dir = "PATH"
os.chdir(pdf_dir)
print("PDF to image start...")
for pdf_file in os.listdir(pdf_dir):
if pdf_file.endswith(".pdf"):
pages = convert_from_path(pdf_file, 150,None,1,1)
pdf_file = pdf_file[:-4]
pages[0].save("%s.jpg" %... | true | true |
1c38359cb800082b537261c0842402b9fd7bf36f | 84 | py | Python | backend/fms_core/template_importer/row_handlers/container_rename/__init__.py | c3g/freezeman | bc4b6c8a2876e888ce41b7d14127cc22bc2b2143 | [
"W3C"
] | 2 | 2021-07-31T13:20:08.000Z | 2021-09-28T13:18:55.000Z | backend/fms_core/template_importer/row_handlers/container_creation/__init__.py | c3g/freezeman | bc4b6c8a2876e888ce41b7d14127cc22bc2b2143 | [
"W3C"
] | 71 | 2021-03-12T22:08:19.000Z | 2022-03-25T15:24:40.000Z | backend/fms_core/template_importer/row_handlers/container_rename/__init__.py | c3g/freezeman | bc4b6c8a2876e888ce41b7d14127cc22bc2b2143 | [
"W3C"
] | null | null | null | from .container import ContainerRowHandler
__all__ = [
"ContainerRowHandler",
] | 16.8 | 42 | 0.761905 | from .container import ContainerRowHandler
__all__ = [
"ContainerRowHandler",
] | true | true |
1c3836841e8cbea4eab578bd595d3c962670d427 | 4,334 | py | Python | senlin-7.0.0/senlin/objects/profile.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 45 | 2015-10-18T02:56:50.000Z | 2022-03-01T15:28:02.000Z | senlin-7.0.0/senlin/objects/profile.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | senlin-7.0.0/senlin/objects/profile.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 45 | 2015-10-19T02:35:57.000Z | 2021-09-28T09:01:42.000Z | # 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, software
# distributed unde... | 36.728814 | 75 | 0.643747 |
from oslo_utils import uuidutils
from senlin.common import exception
from senlin.common import utils
from senlin.db import api as db_api
from senlin.objects import base
from senlin.objects import fields
@base.SenlinObjectRegistry.register
class Profile(base.SenlinObject, base.VersionedObjectDictCompat):
... | true | true |
1c38375926e5e1f1169c96ab24e03ac84e1f9163 | 1,355 | py | Python | python/week9.py | Coding-Dojo-ACC/group-a-project | 5c5dbf5eb124f78a239de1f80f8b2178e6734e6a | [
"MIT"
] | null | null | null | python/week9.py | Coding-Dojo-ACC/group-a-project | 5c5dbf5eb124f78a239de1f80f8b2178e6734e6a | [
"MIT"
] | null | null | null | python/week9.py | Coding-Dojo-ACC/group-a-project | 5c5dbf5eb124f78a239de1f80f8b2178e6734e6a | [
"MIT"
] | 3 | 2021-02-13T01:20:23.000Z | 2021-02-26T22:29:13.000Z | # Count by 5's
# for x in range(5,1000,1) # start at 5 go till 1000 and count every number
# for x in range(5, 101, 5): # start at 5 go till 1000 and add 5 each iteration
# print(x)
# for y in range(5, 101, 1):
# if y % 5 == 0:
# print(y)
def flexCount(lowNum, hiNum, mult):
for i in range(lowN... | 17.828947 | 90 | 0.551292 |
# for x in range(5,1000,1) # start at 5 go till 1000 and count every number
# for x in range(5, 101, 5): # start at 5 go till 1000 and add 5 each iteration
# print(x)
# for y in range(5, 101, 1):
# if y % 5 == 0:
# print(y)
def flexCount(lowNum, hiNum, mult):
for i in range(lowNum, hiNum +1):... | true | true |
1c3838cada30eb800ddeba7a72d0d4717094e377 | 4,686 | py | Python | research/concatenate_some.py | Nemo157/rust-brotli | 458f5780a37674c3bae38212e11166b22d3198b1 | [
"BSD-3-Clause"
] | 628 | 2016-04-24T16:26:34.000Z | 2022-03-29T19:56:19.000Z | research/concatenate_some.py | Nemo157/rust-brotli | 458f5780a37674c3bae38212e11166b22d3198b1 | [
"BSD-3-Clause"
] | 43 | 2016-06-30T09:24:23.000Z | 2022-03-31T07:54:52.000Z | research/concatenate_some.py | Nemo157/rust-brotli | 458f5780a37674c3bae38212e11166b22d3198b1 | [
"BSD-3-Clause"
] | 75 | 2016-04-17T06:41:13.000Z | 2022-03-27T17:27:41.000Z | import sys
import os
import random as insecure_random
import subprocess
import hashlib
import traceback
def get_goal():
ret = insecure_random.randrange(1,16)
if ret == 15:
ret = insecure_random.randrange(15,64)
return ret
def shasum(work):
sha = hashlib.sha256()
for file in work:
w... | 33.956522 | 207 | 0.58344 | import sys
import os
import random as insecure_random
import subprocess
import hashlib
import traceback
def get_goal():
ret = insecure_random.randrange(1,16)
if ret == 15:
ret = insecure_random.randrange(15,64)
return ret
def shasum(work):
sha = hashlib.sha256()
for file in work:
w... | false | true |
1c3838f06848ee092c71412bf25ae399d92d7be1 | 7,375 | py | Python | napari/_vispy/vispy_image_layer.py | glyg/napari | be196dc979aed663a484f3a424dacc3227f7c958 | [
"BSD-3-Clause"
] | null | null | null | napari/_vispy/vispy_image_layer.py | glyg/napari | be196dc979aed663a484f3a424dacc3227f7c958 | [
"BSD-3-Clause"
] | null | null | null | napari/_vispy/vispy_image_layer.py | glyg/napari | be196dc979aed663a484f3a424dacc3227f7c958 | [
"BSD-3-Clause"
] | null | null | null | from vispy.scene.visuals import Image as ImageNode
from vispy.scene.visuals import Volume as VolumeNode
from vispy.color import Colormap
import numpy as np
from .vispy_base_layer import VispyBaseLayer
texture_dtypes = [
np.dtype(np.int8),
np.dtype(np.uint8),
np.dtype(np.int16),
np.dtype(np.uint16),
... | 33.371041 | 111 | 0.591051 | from vispy.scene.visuals import Image as ImageNode
from vispy.scene.visuals import Volume as VolumeNode
from vispy.color import Colormap
import numpy as np
from .vispy_base_layer import VispyBaseLayer
texture_dtypes = [
np.dtype(np.int8),
np.dtype(np.uint8),
np.dtype(np.int16),
np.dtype(np.uint16),
... | true | true |
1c38393694c909953a0d211d283cb8167bf40c92 | 17,023 | py | Python | pull_into_place/commands/01_setup_workspace.py | Kortemme-Lab/pull_into_place | 0019a6cec2a6130ebbaa49d7ab67d4c840fbe33c | [
"MIT"
] | 3 | 2018-05-31T18:46:46.000Z | 2020-05-04T03:27:38.000Z | pull_into_place/commands/01_setup_workspace.py | Kortemme-Lab/pull_into_place | 0019a6cec2a6130ebbaa49d7ab67d4c840fbe33c | [
"MIT"
] | 14 | 2016-09-14T00:16:49.000Z | 2018-04-11T03:04:21.000Z | pull_into_place/commands/01_setup_workspace.py | Kortemme-Lab/pull_into_place | 0019a6cec2a6130ebbaa49d7ab67d4c840fbe33c | [
"MIT"
] | 1 | 2017-11-27T07:35:56.000Z | 2017-11-27T07:35:56.000Z | #!/usr/bin/env python2
"""\
Query the user for all the input data needed for a design. This includes a
starting PDB file, the backbone regions that will be remodeled, the residues
that will be allowed to design, and more. A brief description of each field is
given below. This information is used to build a workspac... | 34.883197 | 98 | 0.669447 |
"""\
Query the user for all the input data needed for a design. This includes a
starting PDB file, the backbone regions that will be remodeled, the residues
that will be allowed to design, and more. A brief description of each field is
given below. This information is used to build a workspace for this design
that... | false | true |
1c3839b056d2f071491f44d4a6e908496eab21cc | 979 | py | Python | setup.py | spell00/pytorch-fmri | 42abd1e5a9a54cd4f4b7e0e89579301203d0aeb0 | [
"MIT"
] | null | null | null | setup.py | spell00/pytorch-fmri | 42abd1e5a9a54cd4f4b7e0e89579301203d0aeb0 | [
"MIT"
] | null | null | null | setup.py | spell00/pytorch-fmri | 42abd1e5a9a54cd4f4b7e0e89579301203d0aeb0 | [
"MIT"
] | null | null | null | import os
import sys
from distutils.sysconfig import get_python_lib
from distutils.core import setup
from setuptools import find_packages
CURRENT_PYTHON = sys.version_info[:2]
setup(name="fmri", version="0.2",
description="A package for learning to classify raw audio according to a user's self-definied "
... | 31.580645 | 101 | 0.490296 | import os
import sys
from distutils.sysconfig import get_python_lib
from distutils.core import setup
from setuptools import find_packages
CURRENT_PYTHON = sys.version_info[:2]
setup(name="fmri", version="0.2",
description="A package for learning to classify raw audio according to a user's self-definied "
... | true | true |
1c383a6063e6bece097dd6a9255159222e9b8380 | 70,322 | py | Python | tensorflow_model_analysis/writers/metrics_plots_and_validations_writer_test.py | jaymessina3/model-analysis | 8638ad375d860a97df5938850c59c72b0def995a | [
"Apache-2.0"
] | 1,118 | 2018-03-30T02:01:17.000Z | 2022-03-22T07:25:58.000Z | tensorflow_model_analysis/writers/metrics_plots_and_validations_writer_test.py | jaymessina3/model-analysis | 8638ad375d860a97df5938850c59c72b0def995a | [
"Apache-2.0"
] | 82 | 2018-04-12T12:54:05.000Z | 2022-03-31T11:14:31.000Z | tensorflow_model_analysis/writers/metrics_plots_and_validations_writer_test.py | jaymessina3/model-analysis | 8638ad375d860a97df5938850c59c72b0def995a | [
"Apache-2.0"
] | 280 | 2018-03-30T15:58:02.000Z | 2022-03-21T07:41:53.000Z | # Lint as: python3
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 33.695256 | 98 | 0.543998 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import string
import tempfile
from absl.testing import parameterized
import apache_beam as beam
from apache_beam.testing import util
import numpy as np
import tensorflow as tf
from ten... | true | true |
1c383a645bd26f9fa6a5955ec222204a3829f31e | 5,276 | py | Python | tests/filters/path_filter.py | pyllyukko/plaso | 7533db2d1035ca71d264d6281ebd5db2d073c587 | [
"Apache-2.0"
] | 1,253 | 2015-01-02T13:58:02.000Z | 2022-03-31T08:43:39.000Z | tests/filters/path_filter.py | pyllyukko/plaso | 7533db2d1035ca71d264d6281ebd5db2d073c587 | [
"Apache-2.0"
] | 3,388 | 2015-01-02T11:17:58.000Z | 2022-03-30T10:21:45.000Z | tests/filters/path_filter.py | pyllyukko/plaso | 7533db2d1035ca71d264d6281ebd5db2d073c587 | [
"Apache-2.0"
] | 376 | 2015-01-20T07:04:54.000Z | 2022-03-04T23:53:00.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the scan tree-based path filter."""
import unittest
from plaso.filters import path_filter
from tests.filters import test_lib
class PathFilterScanTreeTest(test_lib.FilterTestCase):
"""Tests for the path filter scan tree."""
# pylint: disable=protected... | 44.711864 | 77 | 0.69674 |
import unittest
from plaso.filters import path_filter
from tests.filters import test_lib
class PathFilterScanTreeTest(test_lib.FilterTestCase):
def testInitialize(self):
scan_tree = path_filter.PathFilterScanTree([])
self.assertIsNone(scan_tree._root_node)
paths = [
'HKEY_CURRENT_USER... | true | true |
1c383c031f1ec6570de8548f7cf0b056ff16dca3 | 1,000 | py | Python | face.py | yahya-idriss/Python-Personal-assistant | 97ebac124441f3fbcb6d74a4e33da14e4632afc0 | [
"MIT"
] | null | null | null | face.py | yahya-idriss/Python-Personal-assistant | 97ebac124441f3fbcb6d74a4e33da14e4632afc0 | [
"MIT"
] | null | null | null | face.py | yahya-idriss/Python-Personal-assistant | 97ebac124441f3fbcb6d74a4e33da14e4632afc0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import cv2
import numpy as np
import sqlite3
from function import function
class face_detect():
def __init__(self):
self.cam = cv2.VideoCapture(0)
self.detector=cv2.CascadeClassifier("haarcascade_frontalface_default.xml")
server = function()
self.id = serve... | 25 | 94 | 0.583 |
import os
import cv2
import numpy as np
import sqlite3
from function import function
class face_detect():
def __init__(self):
self.cam = cv2.VideoCapture(0)
self.detector=cv2.CascadeClassifier("haarcascade_frontalface_default.xml")
server = function()
self.id = server.get_last_id()
... | true | true |
1c383c2418e352a46d37f1383de7f35a738196ea | 190 | py | Python | grid_tuple.py | ErnestoPena/Game-Of-Life.-Python | 046bca4ae1c69e08efed4f45057b097653410ec8 | [
"MIT"
] | null | null | null | grid_tuple.py | ErnestoPena/Game-Of-Life.-Python | 046bca4ae1c69e08efed4f45057b097653410ec8 | [
"MIT"
] | null | null | null | grid_tuple.py | ErnestoPena/Game-Of-Life.-Python | 046bca4ae1c69e08efed4f45057b097653410ec8 | [
"MIT"
] | null | null | null | import random
def construct_main_tuple():
grid_list = []
for y in range(0,100):
for x in range(0,100):
grid_list.append([x*10, y*10, False])
return grid_list | 23.75 | 49 | 0.605263 | import random
def construct_main_tuple():
grid_list = []
for y in range(0,100):
for x in range(0,100):
grid_list.append([x*10, y*10, False])
return grid_list | true | true |
1c383d4343abe437b12bcd988019af09a77e5979 | 3,664 | py | Python | tests/components/garmin_connect/test_config_flow.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 4 | 2020-07-29T17:47:10.000Z | 2020-09-16T13:39:13.000Z | tests/components/garmin_connect/test_config_flow.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 6 | 2020-11-08T19:40:10.000Z | 2022-03-01T11:11:07.000Z | tests/components/garmin_connect/test_config_flow.py | klauern/home-assistant-core | c18ba6aec0627e6afb6442c678edb5ff2bb17db6 | [
"Apache-2.0"
] | 5 | 2020-03-29T00:29:13.000Z | 2021-09-06T20:58:40.000Z | """Test the Garmin Connect config flow."""
from garminconnect import (
GarminConnectAuthenticationError,
GarminConnectConnectionError,
GarminConnectTooManyRequestsError,
)
import pytest
from homeassistant import data_entry_flow
from homeassistant.components.garmin_connect.const import DOMAIN
from homeassis... | 36.64 | 88 | 0.728985 | from garminconnect import (
GarminConnectAuthenticationError,
GarminConnectConnectionError,
GarminConnectTooManyRequestsError,
)
import pytest
from homeassistant import data_entry_flow
from homeassistant.components.garmin_connect.const import DOMAIN
from homeassistant.const import CONF_ID, CONF_PASSWORD, C... | true | true |
1c383d5095d9c1f64070cb21511e8a323a60d196 | 1,832 | py | Python | ml_service/pipelines/diabetes_regression_build_train_pipeline_with_r.py | tspen/MLOpsPython | dee07128e92c37ed6105938825530277672c8339 | [
"MIT"
] | null | null | null | ml_service/pipelines/diabetes_regression_build_train_pipeline_with_r.py | tspen/MLOpsPython | dee07128e92c37ed6105938825530277672c8339 | [
"MIT"
] | null | null | null | ml_service/pipelines/diabetes_regression_build_train_pipeline_with_r.py | tspen/MLOpsPython | dee07128e92c37ed6105938825530277672c8339 | [
"MIT"
] | null | null | null | from azureml.pipeline.steps import PythonScriptStep
from azureml.pipeline.core import Pipeline
from azureml.core import Workspace
from azureml.core.runconfig import RunConfiguration, CondaDependencies
from ml_service.util.attach_compute import get_compute
from ml_service.util.env_variables import Env
def main():
... | 30.533333 | 70 | 0.718341 | from azureml.pipeline.steps import PythonScriptStep
from azureml.pipeline.core import Pipeline
from azureml.core import Workspace
from azureml.core.runconfig import RunConfiguration, CondaDependencies
from ml_service.util.attach_compute import get_compute
from ml_service.util.env_variables import Env
def main():
... | true | true |
1c383e37261953fcc99197b12f66d9f5d4fdffcd | 13,484 | py | Python | manila/tests/share/drivers/quobyte/test_quobyte.py | nidhimittalhada/access_group_repo | 62f3365bc5fb728fcca692a9b3977690fabcd78f | [
"Apache-2.0"
] | 1 | 2015-05-28T22:28:08.000Z | 2015-05-28T22:28:08.000Z | manila/tests/share/drivers/quobyte/test_quobyte.py | nidhimittalhada/access_group_repo | 62f3365bc5fb728fcca692a9b3977690fabcd78f | [
"Apache-2.0"
] | 5 | 2015-08-13T15:17:28.000Z | 2016-08-02T02:55:01.000Z | manila/tests/share/drivers/quobyte/test_quobyte.py | nidhimittalhada/access_group_repo | 62f3365bc5fb728fcca692a9b3977690fabcd78f | [
"Apache-2.0"
] | 2 | 2015-08-29T08:19:58.000Z | 2016-08-02T02:46:10.000Z | # Copyright (c) 2015 Quobyte, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | 39.426901 | 79 | 0.610427 |
import mock
from oslo_config import cfg
import six
from manila import context
from manila import exception
from manila.share import configuration as config
from manila.share import driver
from manila.share.drivers.quobyte import jsonrpc
from manila.share.drivers.quobyte import quobyte
from manila import... | true | true |
1c383f0c22546fc778beaef16dcd29f57adc3e00 | 4,309 | py | Python | roles/api/files/scripts/export-fworch-config.py | NilsPur/firewall-orchestrator | 1e2dd61abc99b8dc72903abe9ac9c3172420b39f | [
"Apache-2.0"
] | null | null | null | roles/api/files/scripts/export-fworch-config.py | NilsPur/firewall-orchestrator | 1e2dd61abc99b8dc72903abe9ac9c3172420b39f | [
"Apache-2.0"
] | null | null | null | roles/api/files/scripts/export-fworch-config.py | NilsPur/firewall-orchestrator | 1e2dd61abc99b8dc72903abe9ac9c3172420b39f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# export-fworch-config.py: export the full config of the product itself for later import
# does not contain any firewall config data, just the device config plus fworch user config
import sys, logging
import json, requests, requests.packages, argparse
base_dir = "/usr/local/fworch"
importer_base_d... | 36.516949 | 202 | 0.668369 |
import sys, logging
import json, requests, requests.packages, argparse
base_dir = "/usr/local/fworch"
importer_base_dir = base_dir + '/importer'
sys.path.append(importer_base_dir)
import common, fwo_api
parser = argparse.ArgumentParser(
description='Export fworch configuration into encrypted json file')
parser... | true | true |
1c383f218af36d693de4546a8854dc5ea2264b12 | 785 | py | Python | resource_group.py | gfortil/hpcc-internship | 8061771bcb4791fca54e6b1d74f0c019ad69bca4 | [
"MIT"
] | null | null | null | resource_group.py | gfortil/hpcc-internship | 8061771bcb4791fca54e6b1d74f0c019ad69bca4 | [
"MIT"
] | null | null | null | resource_group.py | gfortil/hpcc-internship | 8061771bcb4791fca54e6b1d74f0c019ad69bca4 | [
"MIT"
] | 1 | 2021-06-10T22:07:15.000Z | 2021-06-10T22:07:15.000Z | import subprocess
from config import region_codes, resource_prefix, spot_region_map
def create_resource_group(regions, prefix):
for location in regions:
resource_group_name = prefix + str(location)
command = 'az group create --name {} --location {}'.format(resource_group_name, location)
s... | 37.380952 | 98 | 0.719745 | import subprocess
from config import region_codes, resource_prefix, spot_region_map
def create_resource_group(regions, prefix):
for location in regions:
resource_group_name = prefix + str(location)
command = 'az group create --name {} --location {}'.format(resource_group_name, location)
s... | true | true |
1c383f6db61bddf20a7010fc1424b0b3afd68acc | 3,185 | py | Python | chamfer_filter_ds.py | eMYKion/GANSketching | 8b603e6d1836bf55768bc6d17a2ef133c3338a8f | [
"MIT"
] | null | null | null | chamfer_filter_ds.py | eMYKion/GANSketching | 8b603e6d1836bf55768bc6d17a2ef133c3338a8f | [
"MIT"
] | null | null | null | chamfer_filter_ds.py | eMYKion/GANSketching | 8b603e6d1836bf55768bc6d17a2ef133c3338a8f | [
"MIT"
] | null | null | null | import argparse
import os
from tqdm import tqdm
from training.gan_model import GANModel
from PIL import Image
# from torchvision import transforms
import cv2
import numpy as np
import torch
from training import networks
from torchvision import transforms
from options import get_opt
IMG_DIM = (256, 256)
THRES = 100
... | 31.534653 | 126 | 0.585243 | import argparse
import os
from tqdm import tqdm
from training.gan_model import GANModel
from PIL import Image
import cv2
import numpy as np
import torch
from training import networks
from torchvision import transforms
from options import get_opt
IMG_DIM = (256, 256)
THRES = 100
def main():
parser = argpar... | false | true |
1c383f8b680f153f22ac31cf1562d4db70ad8920 | 5,771 | py | Python | pychron/experiment/automated_run/factory_view.py | UManPychron/pychron | b84c9fd70072f9cbda30abe2c471e64fe3dd75d8 | [
"Apache-2.0"
] | null | null | null | pychron/experiment/automated_run/factory_view.py | UManPychron/pychron | b84c9fd70072f9cbda30abe2c471e64fe3dd75d8 | [
"Apache-2.0"
] | 11 | 2015-10-08T14:21:39.000Z | 2022-01-26T14:19:21.000Z | pychron/experiment/automated_run/factory_view.py | UManPychron/pychron | b84c9fd70072f9cbda30abe2c471e64fe3dd75d8 | [
"Apache-2.0"
] | null | null | null | # ===============================================================================
# Copyright 2013 Jake Ross
#
# 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/licens... | 51.990991 | 117 | 0.515162 |
from traits.api import HasTraits, Instance
from traitsui.api import View, Item, VGroup, Spring, HGroup, ButtonEditor
from pychron.core.pychron_traits import BorderVGroup
from pychron.core.ui.enum_editor import myEnumEditor
from pychron.envisage.icon_button_editor import icon_button_editor
POSITION_TO... | true | true |
1c383fa231a973a2a7b50cd154fe5a04a62e5ecd | 1,494 | py | Python | txt_file_keyword_extractor.py | Santara/autoSLR | 8c524b8a0023d1434cb7be4e110103605d0d2cab | [
"MIT"
] | 1 | 2020-08-12T23:17:38.000Z | 2020-08-12T23:17:38.000Z | txt_file_keyword_extractor.py | Santara/autoSLR | 8c524b8a0023d1434cb7be4e110103605d0d2cab | [
"MIT"
] | null | null | null | txt_file_keyword_extractor.py | Santara/autoSLR | 8c524b8a0023d1434cb7be4e110103605d0d2cab | [
"MIT"
] | 1 | 2019-08-29T09:36:46.000Z | 2019-08-29T09:36:46.000Z | import os
import sys
in_file = sys.argv[1]
NUM_KEYWORDS_FROM_EACH_FILE = 25
num_keywords_extracted_f = open("Results/num_keywords_extracted.csv","a")
output_f = open('Results/keyword-frequency_list.csv','a')
#Preprocessing
text=[]
with open(in_file) as f:
text=[l.strip() for l in f if len(l.strip())>2]
data=''
fo... | 27.163636 | 107 | 0.726908 | import os
import sys
in_file = sys.argv[1]
NUM_KEYWORDS_FROM_EACH_FILE = 25
num_keywords_extracted_f = open("Results/num_keywords_extracted.csv","a")
output_f = open('Results/keyword-frequency_list.csv','a')
text=[]
with open(in_file) as f:
text=[l.strip() for l in f if len(l.strip())>2]
data=''
for t in text:
... | false | true |
1c383fa67b9d2957203adcded4175c56335b4298 | 37,114 | py | Python | CodonSubstitution/build/biopython/Bio/Restriction/_Update/RestrictionCompiler.py | JackCurragh/DARNED | 13963d129bd8f69fb1106ad1f47394b3211a939c | [
"MIT"
] | 37 | 2015-02-24T18:58:30.000Z | 2021-03-07T21:22:18.000Z | CodonSubstitution/build/biopython/Bio/Restriction/_Update/RestrictionCompiler.py | JackCurragh/DARNED | 13963d129bd8f69fb1106ad1f47394b3211a939c | [
"MIT"
] | 12 | 2016-06-09T21:57:00.000Z | 2020-09-11T18:48:51.000Z | CodonSubstitution/build/biopython/Bio/Restriction/_Update/RestrictionCompiler.py | JackCurragh/DARNED | 13963d129bd8f69fb1106ad1f47394b3211a939c | [
"MIT"
] | 19 | 2016-03-26T08:15:17.000Z | 2021-04-12T05:03:29.000Z | #!/usr/bin/env python
#
# Restriction Analysis Libraries.
# Copyright (C) 2004. Frederic Sohm.
#
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
#
# this script is used to produce the dict... | 37.948875 | 85 | 0.500701 |
"""
import sre
import os
import itertools
import time
import sys
import site
import shutil
from Bio.Seq import Seq
from Bio.Alphabet import IUPAC
import Bio.Restriction.Restriction
from Bio.Restriction.Restriction import AbstractCut, RestrictionType, NoCut, OneCut,\
TwoCuts, Meth_Dep, Meth_Undep, Palindr... | false | true |
1c384065f5f0c168b0082b1c67a44eacd1b94183 | 1,376 | py | Python | service/__init__.py | nyu-devops-wishlist/wishlist | b0a99a6f9905dc8547ccbc6375e5d6db512102cf | [
"Apache-2.0"
] | 1 | 2020-03-05T21:44:09.000Z | 2020-03-05T21:44:09.000Z | service/__init__.py | nyu-devops-wishlist/wishlist | b0a99a6f9905dc8547ccbc6375e5d6db512102cf | [
"Apache-2.0"
] | 79 | 2020-02-25T23:55:32.000Z | 2020-05-12T17:44:53.000Z | service/__init__.py | nyu-devops-wishlist/wishlist | b0a99a6f9905dc8547ccbc6375e5d6db512102cf | [
"Apache-2.0"
] | 1 | 2020-03-10T21:58:13.000Z | 2020-03-10T21:58:13.000Z | """
Package: service
Package for the application models and service routes
This module creates and configures the Flask app and sets up the logging
and SQL database
"""
import os
import sys
import logging
from flask import Flask
# Create Flask application
app = Flask(__name__)
app.config.from_object('conf... | 32 | 116 | 0.694767 | import os
import sys
import logging
from flask import Flask
app = Flask(__name__)
app.config.from_object('config')
from service import service, models
if __name__ != '__main__':
gunicorn_logger = logging.getLogger('gunicorn.error')
app.logger.handlers = gunicorn_logger.handlers
app.logger... | true | true |
1c384344aae69c08b0bf6b297a873f04d8fd7c49 | 49,993 | py | Python | parser/team23/interface.py | itsmjoe/tytus | 3b0341cc854d67979b766c5c8b06ed172ce0c913 | [
"MIT"
] | null | null | null | parser/team23/interface.py | itsmjoe/tytus | 3b0341cc854d67979b766c5c8b06ed172ce0c913 | [
"MIT"
] | null | null | null | parser/team23/interface.py | itsmjoe/tytus | 3b0341cc854d67979b766c5c8b06ed172ce0c913 | [
"MIT"
] | null | null | null | from tkinter import *
from tkinter import ttk
from tkinter import filedialog
from PIL import Image, ImageTk
import grammar.sql_grammar as gramatica
from graphviz import Source
from tools.console_text import *
from error.errores import *
from tools.tabla_simbolos import *
import os
class window:
def __init__(self... | 46.461896 | 218 | 0.597784 | from tkinter import *
from tkinter import ttk
from tkinter import filedialog
from PIL import Image, ImageTk
import grammar.sql_grammar as gramatica
from graphviz import Source
from tools.console_text import *
from error.errores import *
from tools.tabla_simbolos import *
import os
class window:
def __init__(self... | true | true |
1c38434c1e88f2c41b796918c5a9fbb25223104e | 3,558 | py | Python | src/cnn_text/exp10.py | numb3r33/dl_nlp | 3b28b883de08efaa2eec4bb3d976906c94b926d6 | [
"MIT"
] | null | null | null | src/cnn_text/exp10.py | numb3r33/dl_nlp | 3b28b883de08efaa2eec4bb3d976906c94b926d6 | [
"MIT"
] | 11 | 2020-03-24T16:56:30.000Z | 2022-03-11T23:45:08.000Z | src/cnn_text/exp10.py | numb3r33/dl_nlp | 3b28b883de08efaa2eec4bb3d976906c94b926d6 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import os
import argparse
from utils import *
from train import *
from losses import *
from models import *
SAMPLE_BASEPATH = '../../data/jigsaw_toxic/processed/'
BASEPATH = '../../data/jigsaw_toxic/raw/'
SUB_PATH = '../../submissions/'
MODEL_FP = '../../mo... | 40.431818 | 172 | 0.68606 | import pandas as pd
import numpy as np
import os
import argparse
from utils import *
from train import *
from losses import *
from models import *
SAMPLE_BASEPATH = '../../data/jigsaw_toxic/processed/'
BASEPATH = '../../data/jigsaw_toxic/raw/'
SUB_PATH = '../../submissions/'
MODEL_FP = '../../mo... | true | true |
1c38437f64fca9bd28d1e4f5a7c12568c004f30a | 909 | py | Python | receiver.py | lobdellb/brycemodem | d95431e93b54b08d07ebefc7b64b8c89764a4f12 | [
"MIT"
] | null | null | null | receiver.py | lobdellb/brycemodem | d95431e93b54b08d07ebefc7b64b8c89764a4f12 | [
"MIT"
] | null | null | null | receiver.py | lobdellb/brycemodem | d95431e93b54b08d07ebefc7b64b8c89764a4f12 | [
"MIT"
] | null | null | null |
import pyaudio
import wave
import time
import sys
if len(sys.argv) < 2:
print("Plays a wave file.\n\nUsage: %s filename.wav" % sys.argv[0])
sys.exit(-1)
wf = wave.open(sys.argv[1], 'rb')
# instantiate PyAudio (1)
p = pyaudio.PyAudio()
# define callback (2)
def callback(in_data, frame_count, time_info, st... | 19.76087 | 71 | 0.656766 |
import pyaudio
import wave
import time
import sys
if len(sys.argv) < 2:
print("Plays a wave file.\n\nUsage: %s filename.wav" % sys.argv[0])
sys.exit(-1)
wf = wave.open(sys.argv[1], 'rb')
p = pyaudio.PyAudio()
def callback(in_data, frame_count, time_info, status):
print(frame_count)
data = wf.... | true | true |
1c384397f9a6a26b3987220dac9d9957db3815cd | 2,482 | py | Python | themes/prompt-toolkit/base16/base16-cupertino.py | base16-fork/base16-fork | 79856b7e6195dde0874a9e6d191101ac6c5c74f5 | [
"MIT"
] | null | null | null | themes/prompt-toolkit/base16/base16-cupertino.py | base16-fork/base16-fork | 79856b7e6195dde0874a9e6d191101ac6c5c74f5 | [
"MIT"
] | null | null | null | themes/prompt-toolkit/base16/base16-cupertino.py | base16-fork/base16-fork | 79856b7e6195dde0874a9e6d191101ac6c5c74f5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# base16-prompt-toolkit (https://github.com/memeplex/base16-prompt-toolkit)
# Base16 Prompt Toolkit template by Carlos Pita (carlosjosepita@gmail.com
# Cupertino scheme by Defman21
try:
# older than v2
from prompt_toolkit.output.vt100 import _256_colors
except ModuleNotFoundError:
# vers... | 29.903614 | 109 | 0.672039 |
try:
from prompt_toolkit.output.vt100 import _256_colors
except ModuleNotFoundError:
from prompt_toolkit.formatted_text.ansi import _256_colors
from pygments.style import Style
from pygments.token import (Keyword, Name, Comment, String, Error, Text,
Number, Operator, Literal,... | true | true |
1c3844f5ad8864ed597c03a7ca8fc9a33d3aea8e | 3,684 | py | Python | examples/resnet/train_fleet_static_amp.py | sandyhouse/FleetX | b3d089cdb0f388c12ad95494ee98053d5bfa450b | [
"Apache-2.0"
] | 170 | 2020-08-12T12:07:01.000Z | 2022-03-07T02:38:26.000Z | examples/resnet/train_fleet_static_amp.py | sandyhouse/FleetX | b3d089cdb0f388c12ad95494ee98053d5bfa450b | [
"Apache-2.0"
] | 195 | 2020-08-13T03:22:15.000Z | 2022-03-30T07:40:25.000Z | examples/resnet/train_fleet_static_amp.py | sandyhouse/FleetX | b3d089cdb0f388c12ad95494ee98053d5bfa450b | [
"Apache-2.0"
] | 67 | 2020-08-14T02:07:46.000Z | 2022-03-28T10:05:33.000Z | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 33.798165 | 158 | 0.678882 |
import numpy as np
import argparse
import ast
import paddle
from paddle.distributed import fleet
import resnet_static as resnet
import os
base_lr = 0.1
momentum_rate = 0.9
l2_decay = 1e-4
epoch = 10
batch_size = 32
class_dim = 102
def optimizer_setting(parameter_list=None):
optimizer = paddle.optim... | true | true |
1c38451fb424e2b6a391207b83c511a087bace8a | 6,177 | py | Python | cli/scaleout/details.py | ScilifelabDataCentre/stackn | 00a65a16ff271f04548b3ff475c72dacbfd916df | [
"Apache-2.0"
] | null | null | null | cli/scaleout/details.py | ScilifelabDataCentre/stackn | 00a65a16ff271f04548b3ff475c72dacbfd916df | [
"Apache-2.0"
] | null | null | null | cli/scaleout/details.py | ScilifelabDataCentre/stackn | 00a65a16ff271f04548b3ff475c72dacbfd916df | [
"Apache-2.0"
] | null | null | null | import platform
import psutil
import logging
import json
import os
import sys
from scaleout.cli.helpers import prompt
def get_system_details(info):
try:
info['Platform'] = platform.system()
#info['Platform version'] = platform.version()
info['Architecture'] = platform.machine()
info... | 51.049587 | 151 | 0.646592 | import platform
import psutil
import logging
import json
import os
import sys
from scaleout.cli.helpers import prompt
def get_system_details(info):
try:
info['Platform'] = platform.system()
info['Architecture'] = platform.machine()
info['Processor'] = platform.processor()
i... | true | true |
1c3845d71bd0808be9a45e1440e146be6fafa885 | 11,636 | py | Python | pychron/experiment/experimentor.py | ASUPychron/pychron | dfe551bdeb4ff8b8ba5cdea0edab336025e8cc76 | [
"Apache-2.0"
] | 31 | 2016-03-07T02:38:17.000Z | 2022-02-14T18:23:43.000Z | pychron/experiment/experimentor.py | ASUPychron/pychron | dfe551bdeb4ff8b8ba5cdea0edab336025e8cc76 | [
"Apache-2.0"
] | 1,626 | 2015-01-07T04:52:35.000Z | 2022-03-25T19:15:59.000Z | pychron/experiment/experimentor.py | UIllinoisHALPychron/pychron | f21b79f4592a9fb9dc9a4cb2e4e943a3885ededc | [
"Apache-2.0"
] | 26 | 2015-05-23T00:10:06.000Z | 2022-03-07T16:51:57.000Z | # ===============================================================================
# Copyright 2013 Jake Ross
#
# 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... | 34.942943 | 88 | 0.544173 |
from __future__ import absolute_import
from traits.api import Instance, List, on_trait_change, Bool, Event
from pychron.dvc.dvc_irradiationable import DVCIrradiationable
from pychron.experiment.experiment_executor import ExperimentExecutor
from pychron.experiment.factory import ExperimentFactory
from... | true | true |
1c38463f66647da1607e6d5fc5115661bd36b39a | 5,398 | py | Python | backend/api/viewsets/model_year_report_consumer_sales.py | NavpreetGrewal/zeva | a2fc9241d471bb6a2099bcf48b9589ac9391cc64 | [
"Apache-2.0"
] | null | null | null | backend/api/viewsets/model_year_report_consumer_sales.py | NavpreetGrewal/zeva | a2fc9241d471bb6a2099bcf48b9589ac9391cc64 | [
"Apache-2.0"
] | null | null | null | backend/api/viewsets/model_year_report_consumer_sales.py | NavpreetGrewal/zeva | a2fc9241d471bb6a2099bcf48b9589ac9391cc64 | [
"Apache-2.0"
] | null | null | null | from rest_framework import mixins, viewsets
from rest_framework.response import Response
from django.db.models import Q
from django.shortcuts import get_object_or_404
from api.models.model_year_report_vehicle import ModelYearReportVehicle
from api.models.model_year_report import ModelYearReport
from api.models.model_y... | 38.014085 | 85 | 0.686365 | from rest_framework import mixins, viewsets
from rest_framework.response import Response
from django.db.models import Q
from django.shortcuts import get_object_or_404
from api.models.model_year_report_vehicle import ModelYearReportVehicle
from api.models.model_year_report import ModelYearReport
from api.models.model_y... | true | true |
1c38486b5a0bdf40a741bd9dbc89b9eb9f489f78 | 1,828 | py | Python | modules/exploits/example.py | BA7JCM/metasploit-framework | a977d485084aefda76aeac2b15a8f5a4607938fc | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 2 | 2022-02-19T07:46:56.000Z | 2022-02-22T02:42:09.000Z | modules/exploits/example.py | BA7JCM/metasploit-framework | a977d485084aefda76aeac2b15a8f5a4607938fc | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 5 | 2020-10-08T15:04:39.000Z | 2020-10-08T15:04:46.000Z | modules/exploits/example.py | BA7JCM/metasploit-framework | a977d485084aefda76aeac2b15a8f5a4607938fc | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2022-03-01T05:18:40.000Z | 2022-03-01T05:18:40.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# standard modules
import logging
# extra modules
dependencies_missing = False
try:
import requests
except ImportError:
dependencies_missing = True
from metasploit import module
metadata = {
'name': 'Python Module Example',
'description': '''
P... | 28.123077 | 120 | 0.599562 |
import logging
dependencies_missing = False
try:
import requests
except ImportError:
dependencies_missing = True
from metasploit import module
metadata = {
'name': 'Python Module Example',
'description': '''
Python communication with msfconsole.
''',
'authors': [
'Jacob ... | true | true |
1c384892c1b89f4a0ea6806632905115f06fdd7f | 1,586 | py | Python | var/spack/repos/builtin/packages/sqlcipher/package.py | MiddelkoopT/spack | 4d94c4c4600f42a7a3bb3d06ec879140bc259304 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2021-02-08T15:05:27.000Z | 2021-02-08T15:05:27.000Z | var/spack/repos/builtin/packages/sqlcipher/package.py | MiddelkoopT/spack | 4d94c4c4600f42a7a3bb3d06ec879140bc259304 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/sqlcipher/package.py | MiddelkoopT/spack | 4d94c4c4600f42a7a3bb3d06ec879140bc259304 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2022-01-18T23:39:24.000Z | 2022-01-18T23:39:24.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
class Sqlcipher(AutotoolsPackage):
"""SQLCipher is an SQLite extension that provides 256 bit AES encryption
of d... | 46.647059 | 95 | 0.748424 |
class Sqlcipher(AutotoolsPackage):
homepage = "https://www.zetetic.net/sqlcipher/"
url = "https://github.com/sqlcipher/sqlcipher/archive/v4.4.1.tar.gz"
git = "https://github.com/sqlcipher/sqlcipher.git"
maintainers = ['rmsds']
version('4.4.1', sha256='a36ed7c879a5e9af1054942201c75fc... | true | true |
1c3849e06afbbb9b21ae5df801c2962db406e6ba | 91,397 | py | Python | tests/test_bert_ner.py | bond005/elmo_ner | c6135cfca5d7bf817a22c8c8631e7f81f6f05f94 | [
"Apache-2.0"
] | 80 | 2019-03-21T13:04:32.000Z | 2021-09-27T16:53:34.000Z | tests/test_bert_ner.py | bond005/elmo_ner | c6135cfca5d7bf817a22c8c8631e7f81f6f05f94 | [
"Apache-2.0"
] | 7 | 2019-06-06T13:49:54.000Z | 2022-02-10T01:05:18.000Z | tests/test_bert_ner.py | bond005/elmo_ner | c6135cfca5d7bf817a22c8c8631e7f81f6f05f94 | [
"Apache-2.0"
] | 16 | 2019-03-20T06:54:40.000Z | 2021-09-23T17:40:24.000Z | import copy
import gc
import os
import pickle
import re
import sys
import tempfile
import unittest
import numpy as np
from sklearn.exceptions import NotFittedError
from spacy_udpipe.language import UDPipeLanguage
try:
from deep_ner.bert_ner import BERT_NER
from deep_ner.utils import load_dataset_from_json, se... | 56.980673 | 120 | 0.633642 | import copy
import gc
import os
import pickle
import re
import sys
import tempfile
import unittest
import numpy as np
from sklearn.exceptions import NotFittedError
from spacy_udpipe.language import UDPipeLanguage
try:
from deep_ner.bert_ner import BERT_NER
from deep_ner.utils import load_dataset_from_json, se... | true | true |
1c384a7676714a112d2709b7de2e06ce6bb4ddd8 | 856 | py | Python | tests/test_packages/test_connections/test_tcp/__init__.py | ejfitzgerald/agents-aea | 6411fcba8af2cdf55a3005939ae8129df92e8c3e | [
"Apache-2.0"
] | 126 | 2019-09-07T09:32:44.000Z | 2022-03-29T14:28:41.000Z | tests/test_packages/test_connections/test_tcp/__init__.py | ejfitzgerald/agents-aea | 6411fcba8af2cdf55a3005939ae8129df92e8c3e | [
"Apache-2.0"
] | 1,814 | 2019-08-24T10:08:07.000Z | 2022-03-31T14:28:36.000Z | tests/test_packages/test_connections/test_tcp/__init__.py | ejfitzgerald/agents-aea | 6411fcba8af2cdf55a3005939ae8129df92e8c3e | [
"Apache-2.0"
] | 46 | 2019-09-03T22:13:58.000Z | 2022-03-22T01:25:16.000Z | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI 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 ... | 40.761905 | 80 | 0.58528 | true | true | |
1c384c91f36d0a8c490fb7657c500258ebef08fc | 2,882 | py | Python | utils/common.py | projekgallus/gallus-gui | c7effdcbc68d64d60a96b68a1064d0f590b449b8 | [
"BSD-3-Clause"
] | null | null | null | utils/common.py | projekgallus/gallus-gui | c7effdcbc68d64d60a96b68a1064d0f590b449b8 | [
"BSD-3-Clause"
] | null | null | null | utils/common.py | projekgallus/gallus-gui | c7effdcbc68d64d60a96b68a1064d0f590b449b8 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
## Copyright (c) 2018, Projek Gallus
## Copyright (c) 2017, The Sumokoin Project (www.sumokoin.org)
'''
Misc utility classes/functions for application
'''
import os, sys, string
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
... | 27.711538 | 88 | 0.62526 |
StringIO import StringIO
class DummyStream:
def __init__(self): pass
def write(self,data): pass
def read(self,data): pass
def flush(self): pass
def close(self): pass
def getAppPath():
if hasattr(sys, 'frozen'):
dir_path = os.path.dirname(unicode(sys.executable,... | true | true |
1c384cb0654489f18fed0bfc27fa098d462fab70 | 2,131 | py | Python | core/tests.py | Wanderer2436/django_pharmacy | 2e12c41e30f2f2e2c0f3abdaded98a917420f5b8 | [
"MIT"
] | null | null | null | core/tests.py | Wanderer2436/django_pharmacy | 2e12c41e30f2f2e2c0f3abdaded98a917420f5b8 | [
"MIT"
] | 2 | 2022-03-31T14:34:44.000Z | 2022-03-31T14:35:17.000Z | core/tests.py | Wanderer2436/django_pharmacy | 2e12c41e30f2f2e2c0f3abdaded98a917420f5b8 | [
"MIT"
] | null | null | null | from django.test import TestCase, Client, RequestFactory
from django.urls import reverse
from core import models
class ProductSearchTestCase(TestCase):
def setUp(self):
self.client = Client()
category1 = models.Category.objects.create(name='TestCat1')
category2 = models.Category.objects.cr... | 38.053571 | 97 | 0.650399 | from django.test import TestCase, Client, RequestFactory
from django.urls import reverse
from core import models
class ProductSearchTestCase(TestCase):
def setUp(self):
self.client = Client()
category1 = models.Category.objects.create(name='TestCat1')
category2 = models.Category.objects.cr... | true | true |
1c384ccc0e50dbc39e26da9575b6526332b32a5b | 1,454 | py | Python | jdcloud_sdk/services/antipro/apis/DescribeAttackSourceRequest.py | jdcloud-apigateway/jdcloud-sdk-python | 0886769bcf1fb92128a065ff0f4695be099571cc | [
"Apache-2.0"
] | null | null | null | jdcloud_sdk/services/antipro/apis/DescribeAttackSourceRequest.py | jdcloud-apigateway/jdcloud-sdk-python | 0886769bcf1fb92128a065ff0f4695be099571cc | [
"Apache-2.0"
] | null | null | null | jdcloud_sdk/services/antipro/apis/DescribeAttackSourceRequest.py | jdcloud-apigateway/jdcloud-sdk-python | 0886769bcf1fb92128a065ff0f4695be099571cc | [
"Apache-2.0"
] | null | null | null | # coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 33.045455 | 188 | 0.722146 |
from jdcloud_sdk.core.jdcloudrequest import JDCloudRequest
class DescribeAttackSourceRequest(JDCloudRequest):
def __init__(self, parameters, header=None, version="v1"):
super(DescribeAttackSourceRequest, self).__init__(
'/attacklog/{attackLogId}:describeAttackSource', 'GET',... | true | true |
1c384d63920592db9836d8b889c140103e7fa797 | 1,867 | py | Python | pdf_render/helpers/dados_testes.py | mauriciolongato/costurApp | 7a700ef43e94023ee94c962873f9e2324e0f7530 | [
"MIT"
] | 1 | 2019-05-12T19:16:07.000Z | 2019-05-12T19:16:07.000Z | pdf_render/helpers/dados_testes.py | mauriciolongato/costurApp | 7a700ef43e94023ee94c962873f9e2324e0f7530 | [
"MIT"
] | null | null | null | pdf_render/helpers/dados_testes.py | mauriciolongato/costurApp | 7a700ef43e94023ee94c962873f9e2324e0f7530 | [
"MIT"
] | null | null | null | from helpers import jobs, functions
def informacao_caixa():
data = {'header': {'nome_cliente': 'Polo',
'nome_caixa': 1,
'pedido_op': 'REF: COD10000001',
'referencia_id': 1,
'nome_referencia': 'Camisa Polo com Bolso',
... | 47.871795 | 112 | 0.447242 | from helpers import jobs, functions
def informacao_caixa():
data = {'header': {'nome_cliente': 'Polo',
'nome_caixa': 1,
'pedido_op': 'REF: COD10000001',
'referencia_id': 1,
'nome_referencia': 'Camisa Polo com Bolso',
... | true | true |
1c384d76c4cde6b1c2953f675082b314778a5507 | 966 | py | Python | pdb2pqr/tests/propka_test.py | ashermancinelli/apbs-pdb2pqr | 0b1bc0126331cf3f1e08667ccc70dae8eda5cd00 | [
"BSD-3-Clause"
] | null | null | null | pdb2pqr/tests/propka_test.py | ashermancinelli/apbs-pdb2pqr | 0b1bc0126331cf3f1e08667ccc70dae8eda5cd00 | [
"BSD-3-Clause"
] | null | null | null | pdb2pqr/tests/propka_test.py | ashermancinelli/apbs-pdb2pqr | 0b1bc0126331cf3f1e08667ccc70dae8eda5cd00 | [
"BSD-3-Clause"
] | null | null | null | """Tests for PROPKA functionality."""
import logging
from pathlib import Path
import pytest
import common
_LOGGER = logging.getLogger(__name__)
@pytest.mark.parametrize("input_pdb", ["1K1I", "1AFS", "1FAS", "5DV8", "5D8V"], ids=str)
def test_propka_apo(input_pdb, tmp_path):
"""PROPKA non-regression tests on pro... | 35.777778 | 88 | 0.693582 | import logging
from pathlib import Path
import pytest
import common
_LOGGER = logging.getLogger(__name__)
@pytest.mark.parametrize("input_pdb", ["1K1I", "1AFS", "1FAS", "5DV8", "5D8V"], ids=str)
def test_propka_apo(input_pdb, tmp_path):
args = "--log-level=INFO --ff=AMBER --drop-water --titration-state-method=p... | true | true |
1c384db9b4b4396fd411433687e067b395fac623 | 1,681 | py | Python | pakaman/config/targets.py | mikonse/pakaman | 4b6ac2ec550bfd642d34dce1fc406f2bd230e8de | [
"MIT"
] | 1 | 2020-10-18T17:57:30.000Z | 2020-10-18T17:57:30.000Z | pakaman/config/targets.py | mikonse/pakaman | 4b6ac2ec550bfd642d34dce1fc406f2bd230e8de | [
"MIT"
] | null | null | null | pakaman/config/targets.py | mikonse/pakaman | 4b6ac2ec550bfd642d34dce1fc406f2bd230e8de | [
"MIT"
] | null | null | null | from abc import ABCMeta
from typing import List, Dict
import schema
TARGETS = {}
class TargetMeta(ABCMeta):
def __init__(cls, name, bases, classdict):
super().__init__(name, bases, classdict)
TARGETS[cls.name] = cls
class Target(metaclass=TargetMeta):
name = "unknown"
schema = schema.S... | 30.017857 | 107 | 0.66627 | from abc import ABCMeta
from typing import List, Dict
import schema
TARGETS = {}
class TargetMeta(ABCMeta):
def __init__(cls, name, bases, classdict):
super().__init__(name, bases, classdict)
TARGETS[cls.name] = cls
class Target(metaclass=TargetMeta):
name = "unknown"
schema = schema.S... | true | true |
1c384df1fb49a37e50cba49829227f17caf3f362 | 1,404 | py | Python | AutoTriageBot/DataTypes.py | jaydave/AutoTriageBot | d87898ec11d6057797697ffa867ccb52770e65ec | [
"BSD-3-Clause"
] | 58 | 2017-09-20T16:50:25.000Z | 2021-05-15T10:22:53.000Z | AutoTriageBot/DataTypes.py | jaydave/AutoTriageBot | d87898ec11d6057797697ffa867ccb52770e65ec | [
"BSD-3-Clause"
] | 2 | 2017-09-21T17:04:10.000Z | 2017-09-25T23:29:20.000Z | AutoTriageBot/DataTypes.py | jaydave/AutoTriageBot | d87898ec11d6057797697ffa867ccb52770e65ec | [
"BSD-3-Clause"
] | 16 | 2017-09-21T00:48:37.000Z | 2021-01-02T20:22:39.000Z | """
Copyright (c) 2017, salesforce.com, inc.
All rights reserved.
Licensed under the BSD 3-Clause license.
For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
from typing import NamedTuple, Mapping, Any
from datetime import datetime
# Represents the result... | 42.545455 | 109 | 0.487179 |
from typing import NamedTuple, Mapping, Any
from datetime import datetime
VulnTestInfo = NamedTuple("VulnTestInfo", [('reproduced', bool),
('info', Mapping[str, Any]),
('message', str),
('... | true | true |
1c384df681c217a87980cd5a3d393f24b508e6e5 | 884 | py | Python | annotate_updated.py | VictoriaSugrue/sheepclock | b0eaec0b96afcc35f0d60982eb3d1215ea329d64 | [
"MIT"
] | null | null | null | annotate_updated.py | VictoriaSugrue/sheepclock | b0eaec0b96afcc35f0d60982eb3d1215ea329d64 | [
"MIT"
] | null | null | null | annotate_updated.py | VictoriaSugrue/sheepclock | b0eaec0b96afcc35f0d60982eb3d1215ea329d64 | [
"MIT"
] | null | null | null | import os
import glob
import numpy as np
import pandas as pd
filenames = [os.path.basename(x) for x in glob.glob("analysis_raw_results/*.bed")]
metadata = pd.read_table('human_factor_full_QC.txt')
for file in filenames:
temp_name = os.path.splitext(file)[0]
df_temp = pd.read_csv("analysis_raw_results/"+str(f... | 49.111111 | 190 | 0.717195 | import os
import glob
import numpy as np
import pandas as pd
filenames = [os.path.basename(x) for x in glob.glob("analysis_raw_results/*.bed")]
metadata = pd.read_table('human_factor_full_QC.txt')
for file in filenames:
temp_name = os.path.splitext(file)[0]
df_temp = pd.read_csv("analysis_raw_results/"+str(f... | true | true |
1c384e0d64e076b98463cdbac0355c84829ca88c | 1,706 | py | Python | pastey/config.py | WolfwithSword/pastey | 89b8c7a4da8a51a25270a2c9f3e6d7526c8211ad | [
"BSD-3-Clause"
] | 65 | 2021-04-13T19:10:03.000Z | 2022-02-03T01:36:04.000Z | pastey/config.py | WolfwithSword/pastey | 89b8c7a4da8a51a25270a2c9f3e6d7526c8211ad | [
"BSD-3-Clause"
] | 15 | 2021-04-14T11:57:43.000Z | 2022-03-22T02:47:15.000Z | pastey/config.py | WolfwithSword/pastey | 89b8c7a4da8a51a25270a2c9f3e6d7526c8211ad | [
"BSD-3-Clause"
] | 8 | 2021-04-15T19:18:00.000Z | 2022-02-03T03:02:27.000Z | # Data directory
data_directory = "./data"
# Listen address
listen_address = "0.0.0.0"
# Listen port
listen_port = 5000
# Use whitelisting
# Whitelisted IPs can view recent pastes on the home page, as well as delete pastes
# For limiting pasting to whitelisted users, enable the "restrict_pasting" option below
use_wh... | 27.516129 | 87 | 0.759086 |
data_directory = "./data"
listen_address = "0.0.0.0"
listen_port = 5000
use_whitelist = True
whitelist_cidr = ['127.0.0.1/32', '10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16']
blacklist_cidr = []
restrict_pasting = False
rate_limit = "5/hour"
guess_threshold = 0.20
recent_pastes = 10
behind_proxy... | true | true |
1c384e41969475a7829dcd8b5e539e84df26a381 | 1,102 | py | Python | 25aapairs.py | 5ophia5/Homework | 7b756e5dd36bf5425a5ba67b7263a45ec2648510 | [
"MIT"
] | null | null | null | 25aapairs.py | 5ophia5/Homework | 7b756e5dd36bf5425a5ba67b7263a45ec2648510 | [
"MIT"
] | null | null | null | 25aapairs.py | 5ophia5/Homework | 7b756e5dd36bf5425a5ba67b7263a45ec2648510 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Print out all the unique pairwise amino acid combinations
# AC is the same as CA
# Skip AA, CC etc.
# Also print out how many combinations there are
aa = 'ACDEFGHIKLMNPQRSTVWY'
combo = 0
for aa1 in aa:
for aa2 in aa:
if aa2 > aa1:
print (aa1, aa2)
combo +=1
print(combo)
"""
python3... | 5.222749 | 59 | 0.557169 |
aa = 'ACDEFGHIKLMNPQRSTVWY'
combo = 0
for aa1 in aa:
for aa2 in aa:
if aa2 > aa1:
print (aa1, aa2)
combo +=1
print(combo)
| true | true |
1c384e66487612e80be41bfcb84c82317974ff4d | 3,353 | py | Python | db/migrations/replaceableObjects.py | DeschutesBrewery/brewerypi | 5459dfc6b1ed415920c13a8a7c9a2d3d3c82099f | [
"MIT"
] | 27 | 2017-11-27T05:01:05.000Z | 2020-11-14T19:52:26.000Z | db/migrations/replaceableObjects.py | DeschutesBrewery/brewerypi | 5459dfc6b1ed415920c13a8a7c9a2d3d3c82099f | [
"MIT"
] | 259 | 2017-11-23T00:43:26.000Z | 2020-11-03T01:07:30.000Z | db/migrations/replaceableObjects.py | DeschutesBrewery/brewerypi | 5459dfc6b1ed415920c13a8a7c9a2d3d3c82099f | [
"MIT"
] | 8 | 2018-10-29T04:39:29.000Z | 2020-10-01T22:18:12.000Z | from alembic.operations import Operations, MigrateOperation
# Concepts from: http://alembic.zzzcomputing.com/en/latest/cookbook.html#replaceable-objects.
class ReplaceableObject(object):
def __init__(self, name, parameters, returns, sqlText):
self.name = name
self.parameters = parameters
s... | 39.447059 | 142 | 0.742917 | from alembic.operations import Operations, MigrateOperation
ject(object):
def __init__(self, name, parameters, returns, sqlText):
self.name = name
self.parameters = parameters
self.returns = returns
self.sqlText = sqlText
class ReversibleOperation(MigrateOperation):
def __init_... | true | true |
1c384ed35a686e610c02507262b0e05c5705abb5 | 599 | py | Python | Curso_de_Python/Mundo_02/Aula_14/Exercicios/ex058.py | tarcisioribeiro/Python | 69b8fee218a6c9b93ae7a6ea36eb903d5ac36955 | [
"MIT"
] | null | null | null | Curso_de_Python/Mundo_02/Aula_14/Exercicios/ex058.py | tarcisioribeiro/Python | 69b8fee218a6c9b93ae7a6ea36eb903d5ac36955 | [
"MIT"
] | null | null | null | Curso_de_Python/Mundo_02/Aula_14/Exercicios/ex058.py | tarcisioribeiro/Python | 69b8fee218a6c9b93ae7a6ea36eb903d5ac36955 | [
"MIT"
] | null | null | null | from random import randint
print()
print('Tente adivinhar o número que estou pensando!')
print()
npc = randint(0, 10)
nuser = -1
palpite = 0
while (npc != nuser):
nuser = int(input('Qual o número que eu pensei? '))
print()
if(nuser == npc):
print('Parabéns! Você acertou!')
print()
elif(n... | 24.958333 | 79 | 0.597663 | from random import randint
print()
print('Tente adivinhar o número que estou pensando!')
print()
npc = randint(0, 10)
nuser = -1
palpite = 0
while (npc != nuser):
nuser = int(input('Qual o número que eu pensei? '))
print()
if(nuser == npc):
print('Parabéns! Você acertou!')
print()
elif(n... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.