hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f748c4a818909a09ac79a7edd1c832ddde05edda | 24,813 | py | Python | lib/googlecloudsdk/third_party/apis/cloudasset/v1p4alpha1/cloudasset_v1p4alpha1_messages.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 2 | 2019-11-10T09:17:07.000Z | 2019-12-18T13:44:08.000Z | lib/googlecloudsdk/third_party/apis/cloudasset/v1p4alpha1/cloudasset_v1p4alpha1_messages.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/third_party/apis/cloudasset/v1p4alpha1/cloudasset_v1p4alpha1_messages.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 1 | 2020-07-25T01:40:19.000Z | 2020-07-25T01:40:19.000Z | """Generated message classes for cloudasset version v1p4alpha1.
The cloud asset API manages the history and inventory of cloud resources.
"""
# NOTE: This file is autogenerated and should not be edited by hand.
from __future__ import absolute_import
from apitools.base.protorpclite import messages as _messages
from a... | 49.037549 | 110 | 0.738806 |
from __future__ import absolute_import
from apitools.base.protorpclite import messages as _messages
from apitools.base.py import encoding
package = 'cloudasset'
class AnalyzeIamPolicyResponse(_messages.Message):
analysisResults = _messages.MessageField('IamPolicyAnalysisResult', 1, repeated=True)
fullyExplo... | true | true |
f748c4c51fc43dd6b1422b0974a244b3f444910a | 1,429 | py | Python | setup.py | aysa-sa/docker-registry-client | 0051598aedff49a7e853384cd038eb1f2fa5eca7 | [
"MIT"
] | null | null | null | setup.py | aysa-sa/docker-registry-client | 0051598aedff49a7e853384cd038eb1f2fa5eca7 | [
"MIT"
] | 1 | 2019-11-28T14:06:04.000Z | 2019-11-28T14:06:04.000Z | setup.py | aysa-sa/docker-registry-client | 0051598aedff49a7e853384cd038eb1f2fa5eca7 | [
"MIT"
] | null | null | null | # Author: Alejandro M. BERNARDIS
# Email: alejandro.bernardis@gmail.com
# Created: 2019/11/22 14:13
# ~
from os import path
from io import open
from setuptools import setup, find_packages
import aysa.docker.registry.__version__ as registry
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'readme... | 26.962264 | 65 | 0.656403 |
from os import path
from io import open
from setuptools import setup, find_packages
import aysa.docker.registry.__version__ as registry
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'readme.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name=registry.__title__,
... | true | true |
f748c56c4f2f9399b2fc41ce758be0fe860841f8 | 2,325 | py | Python | lib/db/database.py | knightoning/zkdash | de1eaf1f02629f87e4a75f9709bb242fcaf56c10 | [
"Apache-2.0"
] | 748 | 2015-10-15T04:06:31.000Z | 2022-01-29T09:28:37.000Z | lib/db/database.py | knightoning/zkdash | de1eaf1f02629f87e4a75f9709bb242fcaf56c10 | [
"Apache-2.0"
] | 30 | 2015-10-18T09:56:42.000Z | 2021-02-19T05:55:23.000Z | lib/db/database.py | knightoning/zkdash | de1eaf1f02629f87e4a75f9709bb242fcaf56c10 | [
"Apache-2.0"
] | 243 | 2015-10-15T06:59:48.000Z | 2022-03-19T18:58:05.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (c) 2014,掌阅科技
All rights reserved.
摘 要: database.py
创 建 者: WangLichao
创建日期: 2015-01-26
"""
# pylint: disable=invalid-name, bare-except
from lib.db.retrydb import MyRetryDB
from peewee import Model as _Model
from peewee import DoesNotExist
from peewee impo... | 24.734043 | 75 | 0.489892 |
from lib.db.retrydb import MyRetryDB
from peewee import Model as _Model
from peewee import DoesNotExist
from peewee import OperationalError
class Database(object):
def __init__(self, **connect_kwargs):
self.connect_kwargs = connect_kwargs
self.load_database()
self.Model = self.get_mo... | true | true |
f748c582f5337911e30c347a0bf7af47b78ad101 | 2,338 | py | Python | tests/integration/element__scroll_to__test.py | pupsikpic/selene | 225796dbd58782c1d4baee85fd6e22eac3a9912f | [
"MIT"
] | 572 | 2015-05-16T19:06:05.000Z | 2022-03-20T08:37:42.000Z | tests/integration/element__scroll_to__test.py | pupsikpic/selene | 225796dbd58782c1d4baee85fd6e22eac3a9912f | [
"MIT"
] | 341 | 2015-11-16T12:16:27.000Z | 2022-03-30T05:57:52.000Z | tests/integration/element__scroll_to__test.py | pupsikpic/selene | 225796dbd58782c1d4baee85fd6e22eac3a9912f | [
"MIT"
] | 160 | 2015-07-05T14:13:18.000Z | 2022-03-02T22:01:41.000Z | # MIT License
#
# Copyright (c) 2015-2021 Iakiv Kramarenko
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modif... | 39.627119 | 80 | 0.7284 |
from selene import be, command
from tests.integration.helpers.givenpage import GivenPage
def test_can_scroll_to_element_manually(session_browser):
session_browser.driver.set_window_size(1000, 100)
GivenPage(session_browser.driver).opened_with_body(
'''
<div id="paragraph" ... | true | true |
f748c59573e10b0badb53a86f6895c048e12204b | 1,641 | py | Python | learn_anaconda/learn_ml/ep5.py | yehonadav/yonadav_tutorials | e797fdaeaea4c5d85392f724442645afb9391f15 | [
"Apache-2.0"
] | 2 | 2019-08-04T17:30:53.000Z | 2020-09-21T08:39:55.000Z | learn_anaconda/learn_ml/ep5.py | yehonadav/yonadav_tutorials | e797fdaeaea4c5d85392f724442645afb9391f15 | [
"Apache-2.0"
] | 5 | 2019-10-31T14:55:58.000Z | 2022-02-26T04:06:39.000Z | learn_anaconda/learn_ml/ep5.py | yehonadav/yonadav_tutorials | e797fdaeaea4c5d85392f724442645afb9391f15 | [
"Apache-2.0"
] | null | null | null | from sklearn import datasets
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
from scipy.spatial import distance
import random
def euc(a, b):
return distance.euclidean(a, b)
# random classifier
class ScrappyRandom:
def fit(self, x_train, y_train):
self.... | 24.492537 | 71 | 0.662401 | from sklearn import datasets
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
from scipy.spatial import distance
import random
def euc(a, b):
return distance.euclidean(a, b)
class ScrappyRandom:
def fit(self, x_train, y_train):
self.x_train = x_train
... | true | true |
f748c689e7964d06a9aed27475976a7ffdd41c1c | 22,066 | py | Python | pyscf/mcscf/test/test_addons.py | umamibeef/pyscf | 1263d54b02914caf4476a3ed9a2de5e0c848954c | [
"Apache-2.0"
] | 501 | 2018-12-06T23:48:17.000Z | 2022-03-31T11:53:18.000Z | pyscf/mcscf/test/test_addons.py | fabijan5/pyscf | 09834c8f5a4f5320cdde29d285b6ccd89b3263e0 | [
"Apache-2.0"
] | 710 | 2018-11-26T22:04:52.000Z | 2022-03-30T03:53:12.000Z | pyscf/mcscf/test/test_addons.py | fabijan5/pyscf | 09834c8f5a4f5320cdde29d285b6ccd89b3263e0 | [
"Apache-2.0"
] | 273 | 2018-11-26T10:10:24.000Z | 2022-03-30T12:25:28.000Z | #!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. 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
#
# U... | 44.132 | 220 | 0.609535 |
import copy
import unittest
from functools import reduce
import numpy, scipy
from pyscf import lib
from pyscf import gto
from pyscf import scf
from pyscf import mcscf
from pyscf import fci
b = 1.4
mol = gto.Mole()
mol.build(
verbose = 7,
output = '/dev/null',
atom = [
['N',( 0.000000, 0.000000, -b... | true | true |
f748c69e21156e193e1ec1a7d9e992605164257c | 9,800 | py | Python | HPEDA/FSANet_Train.py | C3Imaging/SyntheticHeadPose | b139aeda41ace2a07138705a4997d2ea65cb11a6 | [
"MIT"
] | 1 | 2021-02-03T09:49:50.000Z | 2021-02-03T09:49:50.000Z | HPEDA/FSANet_Train.py | C3Imaging/SyntheticHeadPose | b139aeda41ace2a07138705a4997d2ea65cb11a6 | [
"MIT"
] | 1 | 2022-03-25T07:30:38.000Z | 2022-03-25T07:33:48.000Z | HPEDA/FSANet_Train.py | C3Imaging/SyntheticHeadPose | b139aeda41ace2a07138705a4997d2ea65cb11a6 | [
"MIT"
] | null | null | null | import time
import sys
import argparse
import datetime
import pathlib
import numpy as np
import torch
import torch.nn as nn
from torch.autograd import Variable
# Set seed
torch.manual_seed(0)
# Where to add a new import
from torch.optim.lr_scheduler import StepLR
# from torch.utils.tensorboard import SummaryWriter
... | 35.507246 | 109 | 0.551735 | import time
import sys
import argparse
import datetime
import pathlib
import numpy as np
import torch
import torch.nn as nn
from torch.autograd import Variable
torch.manual_seed(0)
from torch.optim.lr_scheduler import StepLR
import datasets
from HPEDA.FSANetDA import FSANet
from utils import AverageMeter
de... | true | true |
f748c6eef9ed81b5657e3dadb49ca344b09f2893 | 5,117 | py | Python | tests/compare_with_ctg/fit_ac_fc/compare_fit_ac_fc.py | bpmunson/ctg | 1407f652fe7aa7df0566d8f619437515aab2e380 | [
"MIT"
] | 2 | 2018-08-24T18:45:19.000Z | 2019-06-26T22:15:00.000Z | tests/compare_with_ctg/fit_ac_fc/compare_fit_ac_fc.py | bpmunson/ctg | 1407f652fe7aa7df0566d8f619437515aab2e380 | [
"MIT"
] | 2 | 2018-08-28T16:43:51.000Z | 2020-07-08T16:01:01.000Z | tests/compare_with_ctg/fit_ac_fc/compare_fit_ac_fc.py | bpmunson/ctg | 1407f652fe7aa7df0566d8f619437515aab2e380 | [
"MIT"
] | 1 | 2020-04-07T18:25:30.000Z | 2020-04-07T18:25:30.000Z | import numpy as np
import pandas as pd
import os
import sys
sys.path.insert(0, "../../../ctg/core")
#from fit_ac_fc import *
from fit_ac_fc2 import Counts
from config import config
abundance_file = os.path.join(config.A549_test, "A549_abundance_thresholds.txt")
counts_file = os.path.join(config.A549_test, "A549_time... | 31.20122 | 110 | 0.615595 | import numpy as np
import pandas as pd
import os
import sys
sys.path.insert(0, "../../../ctg/core")
from fit_ac_fc2 import Counts
from config import config
abundance_file = os.path.join(config.A549_test, "A549_abundance_thresholds.txt")
counts_file = os.path.join(config.A549_test, "A549_timepoint_counts.txt")
time... | true | true |
f748c9fa93f9703acb3b325e70a90737cad5856b | 4,236 | py | Python | ROAR/planning_module/mission_planner/waypoint_following_mission_planner.py | mavabene/ROAR | 51955293ad87128ec2c549142abf91d45314f380 | [
"Apache-2.0"
] | null | null | null | ROAR/planning_module/mission_planner/waypoint_following_mission_planner.py | mavabene/ROAR | 51955293ad87128ec2c549142abf91d45314f380 | [
"Apache-2.0"
] | null | null | null | ROAR/planning_module/mission_planner/waypoint_following_mission_planner.py | mavabene/ROAR | 51955293ad87128ec2c549142abf91d45314f380 | [
"Apache-2.0"
] | null | null | null | from ROAR.planning_module.mission_planner.mission_planner import (
MissionPlanner,
)
from pathlib import Path
import logging
from typing import List, Optional
from ROAR.utilities_module.data_structures_models import Transform, Location, Rotation
from collections import deque
from ROAR.agent_module.agent import Agen... | 36.205128 | 106 | 0.605052 | from ROAR.planning_module.mission_planner.mission_planner import (
MissionPlanner,
)
from pathlib import Path
import logging
from typing import List, Optional
from ROAR.utilities_module.data_structures_models import Transform, Location, Rotation
from collections import deque
from ROAR.agent_module.agent import Agen... | true | true |
f748ca585b30b621a1cc377c8a2fa877efa0fbd9 | 419 | py | Python | backend/delicate_forest_30319/wsgi.py | crowdbotics-apps/delicate-forest-30319 | bbfa9461c8f56a6aa12ca808a59c93f26f203210 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/delicate_forest_30319/wsgi.py | crowdbotics-apps/delicate-forest-30319 | bbfa9461c8f56a6aa12ca808a59c93f26f203210 | [
"FTL",
"AML",
"RSA-MD"
] | 31 | 2021-09-05T01:17:30.000Z | 2022-02-06T17:28:58.000Z | backend/delicate_forest_30319/wsgi.py | crowdbotics-apps/delicate-forest-30319 | bbfa9461c8f56a6aa12ca808a59c93f26f203210 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
WSGI config for delicate_forest_30319 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault... | 24.647059 | 81 | 0.799523 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'delicate_forest_30319.settings')
application = get_wsgi_application()
| true | true |
f748ca6e048700cdf093738524bffc4366879d73 | 3,997 | py | Python | tle_storage_service/tle.py | NikitaKoshelev/tle-storage-service | b891750fbff500ce03784fcd3fd6e0e8c568cd9c | [
"MIT"
] | null | null | null | tle_storage_service/tle.py | NikitaKoshelev/tle-storage-service | b891750fbff500ce03784fcd3fd6e0e8c568cd9c | [
"MIT"
] | null | null | null | tle_storage_service/tle.py | NikitaKoshelev/tle-storage-service | b891750fbff500ce03784fcd3fd6e0e8c568cd9c | [
"MIT"
] | 2 | 2018-03-14T14:39:10.000Z | 2022-02-20T13:11:36.000Z | # -*- coding: utf-8 -*-
import json
from datetime import datetime
import sqlalchemy as sa
from aiopg.sa.result import ResultProxy
from .db import TLE, insert_tle
from .log import logger
from .utils import audit, send_pg_notify
__all__ = (
'get_tle_dt',
'nasa',
'space_track',
)
@audit(logger=logger)
asy... | 31.472441 | 102 | 0.596948 |
import json
from datetime import datetime
import sqlalchemy as sa
from aiopg.sa.result import ResultProxy
from .db import TLE, insert_tle
from .log import logger
from .utils import audit, send_pg_notify
__all__ = (
'get_tle_dt',
'nasa',
'space_track',
)
@audit(logger=logger)
async def space_track(engi... | true | true |
f748cc8796bf3114a59071e4b7c9c0897fac5887 | 289 | py | Python | pythonProject/05al144Subprocess_executar programas e comandos externos/processos.py | D-Wolter/PycharmProjects | c8d6144efa30261bff72a3e0414a0d80f6730f9b | [
"MIT"
] | null | null | null | pythonProject/05al144Subprocess_executar programas e comandos externos/processos.py | D-Wolter/PycharmProjects | c8d6144efa30261bff72a3e0414a0d80f6730f9b | [
"MIT"
] | null | null | null | pythonProject/05al144Subprocess_executar programas e comandos externos/processos.py | D-Wolter/PycharmProjects | c8d6144efa30261bff72a3e0414a0d80f6730f9b | [
"MIT"
] | null | null | null | import subprocess
#Windows - ping 127.0.0.1
#Linux - ping 127.0.0.1 -c 4
# arg0 arg1 arg2 arg3
proc = subprocess.run(
['ping', '127.0.0.1', '-c', '4'],
capture_output=True,
text=True
)
saida = proc.stdout
saida = saida.replace('icmp_seq', 'Dwolter')
print(saida) | 20.642857 | 44 | 0.615917 | import subprocess
proc = subprocess.run(
['ping', '127.0.0.1', '-c', '4'],
capture_output=True,
text=True
)
saida = proc.stdout
saida = saida.replace('icmp_seq', 'Dwolter')
print(saida) | true | true |
f748ccaac94ce45baf7cb45260783933ddd51692 | 3,011 | py | Python | parsers/ecdc.py | rcbevans/covid19_scenarios_data | 4ab313e9feb65e816a06d6995e7ddf568780a0e8 | [
"MIT"
] | null | null | null | parsers/ecdc.py | rcbevans/covid19_scenarios_data | 4ab313e9feb65e816a06d6995e7ddf568780a0e8 | [
"MIT"
] | null | null | null | parsers/ecdc.py | rcbevans/covid19_scenarios_data | 4ab313e9feb65e816a06d6995e7ddf568780a0e8 | [
"MIT"
] | null | null | null | '''
parse country case counts provided by ECDC and write results to TSV
this should be run from the top level of the repo.
Will need to be integrated with other parsers once they become available.
'''
import xlrd
import csv
import json
from urllib.request import urlretrieve
from collections import defaultdict
from da... | 32.376344 | 115 | 0.582531 | import xlrd
import csv
import json
from urllib.request import urlretrieve
from collections import defaultdict
from datetime import datetime, timedelta
from .utils import sorted_date, parse_countries, stoi, store_data
URL = "https://www.ecdc.europa.eu/sites/default/files/documents/COVID-19-geographic-disbtribution... | true | true |
f748cce9b2cdd233330b444202bf55f57327fc77 | 636 | py | Python | keystone/contrib/stats/__init__.py | raildo/keystone-1 | 2b26e45b72e03e64d18dc55cff7db24b7d1b4d5f | [
"Apache-2.0"
] | null | null | null | keystone/contrib/stats/__init__.py | raildo/keystone-1 | 2b26e45b72e03e64d18dc55cff7db24b7d1b4d5f | [
"Apache-2.0"
] | null | null | null | keystone/contrib/stats/__init__.py | raildo/keystone-1 | 2b26e45b72e03e64d18dc55cff7db24b7d1b4d5f | [
"Apache-2.0"
] | 1 | 2021-08-29T16:53:06.000Z | 2021-08-29T16:53:06.000Z | # Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 39.75 | 75 | 0.764151 |
from keystone.contrib.stats.core import *
| true | true |
f748ccfe1ceed3c80096c66c0cb5e43aeeb730f3 | 2,886 | py | Python | detect_video.py | ChouaibBELILITA/Final_year_Project | 688cdeaeabb46fc3f924bb29c2e92865be421d26 | [
"MIT"
] | null | null | null | detect_video.py | ChouaibBELILITA/Final_year_Project | 688cdeaeabb46fc3f924bb29c2e92865be421d26 | [
"MIT"
] | null | null | null | detect_video.py | ChouaibBELILITA/Final_year_Project | 688cdeaeabb46fc3f924bb29c2e92865be421d26 | [
"MIT"
] | null | null | null | import time
from absl import app, flags, logging
from absl.flags import FLAGS
import cv2
import tensorflow as tf
from yolov3_tf2.models import (
YoloV3, YoloV3Tiny
)
from yolov3_tf2.dataset import transform_images
from yolov3_tf2.utils import draw_outputs
flags.DEFINE_string('classes', './data/face.names', 'path ... | 31.369565 | 99 | 0.643105 | import time
from absl import app, flags, logging
from absl.flags import FLAGS
import cv2
import tensorflow as tf
from yolov3_tf2.models import (
YoloV3, YoloV3Tiny
)
from yolov3_tf2.dataset import transform_images
from yolov3_tf2.utils import draw_outputs
flags.DEFINE_string('classes', './data/face.names', 'path ... | true | true |
f748cd466f1f2b11a4ac1b37d95bf0ada75aad3b | 48 | py | Python | djangocms_column/__init__.py | SocialSchools/djangocms-column | 83d9f0aa598b3b0823a364382133cb68d1588389 | [
"BSD-3-Clause"
] | null | null | null | djangocms_column/__init__.py | SocialSchools/djangocms-column | 83d9f0aa598b3b0823a364382133cb68d1588389 | [
"BSD-3-Clause"
] | null | null | null | djangocms_column/__init__.py | SocialSchools/djangocms-column | 83d9f0aa598b3b0823a364382133cb68d1588389 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
__version__ = "1.10.0"
| 12 | 23 | 0.520833 |
__version__ = "1.10.0"
| true | true |
f748cf2e2309de88769ca943c2c1d264ac88002a | 262 | py | Python | whattimeis/scripts/webserver.py | ZhangLSW/HomeWork2 | efe21510d75424bbd617ab546e029c7197fa592b | [
"MIT"
] | null | null | null | whattimeis/scripts/webserver.py | ZhangLSW/HomeWork2 | efe21510d75424bbd617ab546e029c7197fa592b | [
"MIT"
] | null | null | null | whattimeis/scripts/webserver.py | ZhangLSW/HomeWork2 | efe21510d75424bbd617ab546e029c7197fa592b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import rospy, os
import SimpleHTTPServer
def kill():
os.system("kill -KILL " + str(os.getpid()))
os.chdir(os.path.dirname(__file__))
rospy.init_node("webserver")
rospy.on_shutdown(kill)
SimpleHTTPServer.test()
| 20.153846 | 47 | 0.706107 |
import rospy, os
import SimpleHTTPServer
def kill():
os.system("kill -KILL " + str(os.getpid()))
os.chdir(os.path.dirname(__file__))
rospy.init_node("webserver")
rospy.on_shutdown(kill)
SimpleHTTPServer.test()
| true | true |
f748d0117c3093c7786fbe49cbb48bb991f7171b | 12,170 | py | Python | src/garage/tf/regressors/bernoulli_mlp_regressor.py | fangqyi/garage | ddafba385ef005f46f913ab352f9638760e5b412 | [
"MIT"
] | 1 | 2021-03-02T08:43:20.000Z | 2021-03-02T08:43:20.000Z | src/garage/tf/regressors/bernoulli_mlp_regressor.py | fangqyi/garage | ddafba385ef005f46f913ab352f9638760e5b412 | [
"MIT"
] | null | null | null | src/garage/tf/regressors/bernoulli_mlp_regressor.py | fangqyi/garage | ddafba385ef005f46f913ab352f9638760e5b412 | [
"MIT"
] | null | null | null | """Bernoulli MLP Regressor based on MLP with Normalized Inputs."""
from dowel import tabular
import numpy as np
import tensorflow as tf
from garage.tf.distributions import Bernoulli
from garage.tf.misc import tensor_utils
from garage.tf.models import NormalizedInputMLPModel
from garage.tf.optimizers import Con... | 39.512987 | 80 | 0.582662 | from dowel import tabular
import numpy as np
import tensorflow as tf
from garage.tf.distributions import Bernoulli
from garage.tf.misc import tensor_utils
from garage.tf.models import NormalizedInputMLPModel
from garage.tf.optimizers import ConjugateGradientOptimizer, LbfgsOptimizer
from garage.tf.regressors.r... | true | true |
f748d0707cafd3c056be6fa65851296d85a08375 | 2,606 | py | Python | blog/views/views_factory.py | hentt30/education4all | 8f930ade7303fe65355cfe4b2ba66787acad93b4 | [
"MIT"
] | null | null | null | blog/views/views_factory.py | hentt30/education4all | 8f930ade7303fe65355cfe4b2ba66787acad93b4 | [
"MIT"
] | null | null | null | blog/views/views_factory.py | hentt30/education4all | 8f930ade7303fe65355cfe4b2ba66787acad93b4 | [
"MIT"
] | 2 | 2021-06-18T08:13:17.000Z | 2021-12-03T05:08:41.000Z | """
Implements a factory for view classes
"""
from abc import ABC, abstractmethod
from blog.views.about_us import AboutUs
from .posts import PostDetail, PostList, PostListAlgorithms, PostListMathematics
from .contact import ContactUs
from .about_us import AboutUs
class ViewsFactory(ABC):
"""
Generates view ob... | 23.477477 | 80 | 0.630084 | from abc import ABC, abstractmethod
from blog.views.about_us import AboutUs
from .posts import PostDetail, PostList, PostListAlgorithms, PostListMathematics
from .contact import ContactUs
from .about_us import AboutUs
class ViewsFactory(ABC):
@abstractmethod
def create(self):
class PostsDetailFactory(ViewsF... | true | true |
f748d26a52d6a31f3ca5fec4f40b649555f071b5 | 2,103 | py | Python | backend/apps/core/middleware/healthchecks.py | anilvrathod1/bestCDK | c940f27da8e0bcafb901f1f10adfb42308f49543 | [
"MIT"
] | 1 | 2020-07-06T12:34:50.000Z | 2020-07-06T12:34:50.000Z | backend/apps/core/middleware/healthchecks.py | anilvrathod1/bestCDK | c940f27da8e0bcafb901f1f10adfb42308f49543 | [
"MIT"
] | null | null | null | backend/apps/core/middleware/healthchecks.py | anilvrathod1/bestCDK | c940f27da8e0bcafb901f1f10adfb42308f49543 | [
"MIT"
] | null | null | null | """
https://www.ianlewis.org/en/kubernetes-health-checks-django
"""
import logging
import os
import redis
from django.http import HttpResponse, HttpResponseServerError
logger = logging.getLogger("django")
r = redis.Redis(host=os.environ.get("REDIS_SERVICE_HOST"))
class HealthCheckMiddleware(object):
def __init... | 31.38806 | 79 | 0.59106 | import logging
import os
import redis
from django.http import HttpResponse, HttpResponseServerError
logger = logging.getLogger("django")
r = redis.Redis(host=os.environ.get("REDIS_SERVICE_HOST"))
class HealthCheckMiddleware(object):
def __init__(self, get_response):
self.get_response = get_response
... | true | true |
f748d632409b11f9fc7d545d3892dcda883a0a4d | 5,122 | py | Python | docs/conf.py | PEPEcoin/py-evm | 455f1b7bbd284f8ab9760194314672681c025a8b | [
"MIT"
] | 2 | 2018-05-03T03:02:36.000Z | 2018-05-03T03:02:39.000Z | docs/conf.py | PEPEcoin/py-evm | 455f1b7bbd284f8ab9760194314672681c025a8b | [
"MIT"
] | null | null | null | docs/conf.py | PEPEcoin/py-evm | 455f1b7bbd284f8ab9760194314672681c025a8b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the... | 28.455556 | 79 | 0.646232 |
import os
about_fields = [
'author',
'description',
'name',
'url',
'version',
]
about = {}
DIR = os.path.dirname('__file__')
with open(os.path.join(DIR, '../setup.py'), 'r') as f:
for line in f:
for field in about_fields:
if ' ' + field + '=' in line:
... | true | true |
f748d64e91b0338f7a9b1ee6155192ba2aa19808 | 4,108 | py | Python | prenoms/utils.py | cnovel/prenoms | e59b7ed886745fde4fe6b5657b96038ebc7da9db | [
"MIT"
] | 2 | 2020-05-08T13:47:19.000Z | 2021-09-19T19:50:29.000Z | prenoms/utils.py | cnovel/prenoms | e59b7ed886745fde4fe6b5657b96038ebc7da9db | [
"MIT"
] | 10 | 2020-05-08T14:07:18.000Z | 2021-05-17T17:16:06.000Z | prenoms/utils.py | cnovel/prenoms | e59b7ed886745fde4fe6b5657b96038ebc7da9db | [
"MIT"
] | null | null | null | from os.path import abspath, join, dirname
import random
from math import floor
from enum import Enum
def full_names_path(filename: str):
return abspath(join(dirname(__file__), 'data', filename))
FILES = {}
for t in ['first', 'last']:
for gdr in ['.m', '.f']:
# Years
for y in range(1891, 202... | 27.205298 | 89 | 0.543087 | from os.path import abspath, join, dirname
import random
from math import floor
from enum import Enum
def full_names_path(filename: str):
return abspath(join(dirname(__file__), 'data', filename))
FILES = {}
for t in ['first', 'last']:
for gdr in ['.m', '.f']:
for y in range(1891, 2021, 10):... | true | true |
f748d726e6563b39dea87acd38b640915c041236 | 183 | py | Python | python/testData/optimizeImports/blankLineBetweenDocstringAndFirstImportPreserved.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/optimizeImports/blankLineBetweenDocstringAndFirstImportPreserved.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/optimizeImports/blankLineBetweenDocstringAndFirstImportPreserved.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | # pylint: disable=missing-docstring, invalid-name
"""2016 - Day 1 Puzzle Part 2 tests."""
import sys
from mod import solve, in_between, Point
print(solve, in_between, Point, sys) | 18.3 | 49 | 0.73224 |
import sys
from mod import solve, in_between, Point
print(solve, in_between, Point, sys) | true | true |
f748d861fd72816d1e6a9e5123921b5dd2796452 | 1,468 | py | Python | torchaudio/__init__.py | mmxgn/audio | 24741fdb97b9257868ae1caf593207aa7e581b6d | [
"BSD-2-Clause"
] | null | null | null | torchaudio/__init__.py | mmxgn/audio | 24741fdb97b9257868ae1caf593207aa7e581b6d | [
"BSD-2-Clause"
] | null | null | null | torchaudio/__init__.py | mmxgn/audio | 24741fdb97b9257868ae1caf593207aa7e581b6d | [
"BSD-2-Clause"
] | null | null | null | from . import extension
from torchaudio._internal import module_utils as _mod_utils
from torchaudio import (
compliance,
datasets,
kaldi_io,
utils,
sox_effects,
transforms
)
from torchaudio.backend import (
list_audio_backends,
get_audio_backend,
set_audio_backend,
save_encinfo,
... | 25.754386 | 84 | 0.737057 | from . import extension
from torchaudio._internal import module_utils as _mod_utils
from torchaudio import (
compliance,
datasets,
kaldi_io,
utils,
sox_effects,
transforms
)
from torchaudio.backend import (
list_audio_backends,
get_audio_backend,
set_audio_backend,
save_encinfo,
... | true | true |
f748d9727b5bb6d3699a498090b02c28b42e8c55 | 8,687 | py | Python | dump_sqlite.py | lmorgadodacosta/NTUMC | e195e24edf936e869bd602f4cb603bc3aa49f84a | [
"MIT"
] | 2 | 2019-01-03T00:37:31.000Z | 2020-05-01T06:55:41.000Z | dump_sqlite.py | lmorgadodacosta/NTUMC | e195e24edf936e869bd602f4cb603bc3aa49f84a | [
"MIT"
] | 2 | 2019-01-13T09:47:25.000Z | 2019-07-10T09:43:12.000Z | dump_sqlite.py | lmorgadodacosta/NTUMC | e195e24edf936e869bd602f4cb603bc3aa49f84a | [
"MIT"
] | 1 | 2019-01-03T00:37:54.000Z | 2019-01-03T00:37:54.000Z | import os, sys, time, sqlite3
from collections import defaultdict as dd
from lxml import etree
import argparse
################################################################################
# TO DO
################################################################################
# - warn if requested docs do not exis... | 37.769565 | 118 | 0.463912 | import os, sys, time, sqlite3
from collections import defaultdict as dd
from lxml import etree
import argparse
| true | true |
f748da6e832cd39540e42910b74689f6ba037a32 | 3,435 | py | Python | data-preprocessing/view.py | eth-ait/motion-infilling | be814cfe971ec58d0e66c7644db3cdc89f71d092 | [
"BSD-3-Clause"
] | 14 | 2021-04-12T12:23:54.000Z | 2022-03-24T23:44:53.000Z | data-preprocessing/view.py | eth-ait/motion-infilling | be814cfe971ec58d0e66c7644db3cdc89f71d092 | [
"BSD-3-Clause"
] | 2 | 2021-05-07T03:27:30.000Z | 2021-10-08T09:34:03.000Z | data-preprocessing/view.py | eth-ait/motion-infilling | be814cfe971ec58d0e66c7644db3cdc89f71d092 | [
"BSD-3-Clause"
] | 1 | 2021-12-27T07:56:09.000Z | 2021-12-27T07:56:09.000Z | import os
import numpy as np
import matplotlib.animation as animation
import matplotlib.colors as colors
import matplotlib.patheffects as pe
import matplotlib.pyplot as plt
from matplotlib.animation import ArtistAnimation
from mpl_toolkits.mplot3d import Axes3D
from Quaternions import Quaternions
def animation_plot(... | 34.009901 | 120 | 0.555167 | import os
import numpy as np
import matplotlib.animation as animation
import matplotlib.colors as colors
import matplotlib.patheffects as pe
import matplotlib.pyplot as plt
from matplotlib.animation import ArtistAnimation
from mpl_toolkits.mplot3d import Axes3D
from Quaternions import Quaternions
def animation_plot(... | true | true |
f748dbe7f562ac9b1c9fa6a29eb565a539a10612 | 98 | py | Python | config/settings/__init__.py | Pysuper/ZanHu | 7d895cc44a461dee3cfe668e7f0de573196ec594 | [
"MIT"
] | null | null | null | config/settings/__init__.py | Pysuper/ZanHu | 7d895cc44a461dee3cfe668e7f0de573196ec594 | [
"MIT"
] | 5 | 2021-01-07T11:06:23.000Z | 2022-03-31T04:07:16.000Z | config/settings/__init__.py | Pysuper/ZanHu | 7d895cc44a461dee3cfe668e7f0de573196ec594 | [
"MIT"
] | null | null | null | # import pymysql
#
# pymysql.version_info = (1, 4, 14, "final", 0)
# pymysql.install_as_MySQLdb()
| 19.6 | 47 | 0.683673 | true | true | |
f748dc6bc56bcba88a0f28d37ef6657b0fce351f | 1,951 | py | Python | cvtest/reporter.py | AndreyChertckov/opencv-log | a9051e6c9ac0789633da44526897b11fe9e5daba | [
"MIT"
] | 7 | 2020-02-10T13:04:50.000Z | 2020-02-14T13:29:15.000Z | cvtest/reporter.py | AndreyChertckov/opencv-log | a9051e6c9ac0789633da44526897b11fe9e5daba | [
"MIT"
] | null | null | null | cvtest/reporter.py | AndreyChertckov/opencv-log | a9051e6c9ac0789633da44526897b11fe9e5daba | [
"MIT"
] | null | null | null | import os
import traceback
from uuid import uuid4
import cv2
from cvlog import log
from cvlog.config import Config
from cvtest.csv_reporter import CsvReporter
class Reporter:
def __new__(cls):
if not hasattr(cls, 'instance') or not cls.instance:
cls.instance = super().__new__(cls)
... | 31.467742 | 80 | 0.620195 | import os
import traceback
from uuid import uuid4
import cv2
from cvlog import log
from cvlog.config import Config
from cvtest.csv_reporter import CsvReporter
class Reporter:
def __new__(cls):
if not hasattr(cls, 'instance') or not cls.instance:
cls.instance = super().__new__(cls)
... | true | true |
f748dc7746349b7e2bbeee1188558279510af3dc | 671 | py | Python | chocs/serverless/wrapper.py | danballance/chocs | 8a64ce47d98ec327ce709b46c6389c5c627f4157 | [
"MIT"
] | null | null | null | chocs/serverless/wrapper.py | danballance/chocs | 8a64ce47d98ec327ce709b46c6389c5c627f4157 | [
"MIT"
] | null | null | null | chocs/serverless/wrapper.py | danballance/chocs | 8a64ce47d98ec327ce709b46c6389c5c627f4157 | [
"MIT"
] | null | null | null | from typing import Callable
from chocs.http_request import HttpRequest
from chocs.http_response import HttpResponse
from chocs.middleware.middleware import MiddlewarePipeline
from chocs.routing import Route
from .aws import AwsServerlessFunction
from .serverless import IS_AWS_ENVIRONMENT, ServerlessFunction
def cre... | 29.173913 | 103 | 0.821162 | from typing import Callable
from chocs.http_request import HttpRequest
from chocs.http_response import HttpResponse
from chocs.middleware.middleware import MiddlewarePipeline
from chocs.routing import Route
from .aws import AwsServerlessFunction
from .serverless import IS_AWS_ENVIRONMENT, ServerlessFunction
def cre... | true | true |
f748dc95deb90d1e6fb7f72281b136f70ca8886b | 555 | py | Python | leetcode/0720_longest_word_in_dictionary.py | jacquerie/leetcode | a05e6b832eb0e0740aaff7b2eb3109038ad404bf | [
"MIT"
] | 3 | 2018-05-10T09:56:49.000Z | 2020-11-07T18:09:42.000Z | leetcode/0720_longest_word_in_dictionary.py | jacquerie/leetcode | a05e6b832eb0e0740aaff7b2eb3109038ad404bf | [
"MIT"
] | null | null | null | leetcode/0720_longest_word_in_dictionary.py | jacquerie/leetcode | a05e6b832eb0e0740aaff7b2eb3109038ad404bf | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
class Solution:
def longestWord(self, words):
wordsSet = set(words)
result = []
for word in words:
if all(word[:i] in wordsSet for i in range(1, len(word))):
result.append(word)
return min(result, key=lambda el: (-len(el), el))
... | 26.428571 | 98 | 0.54955 |
class Solution:
def longestWord(self, words):
wordsSet = set(words)
result = []
for word in words:
if all(word[:i] in wordsSet for i in range(1, len(word))):
result.append(word)
return min(result, key=lambda el: (-len(el), el))
if __name__ == '__mai... | true | true |
f748dcd6dce40a8285655219740ec4aed6067f09 | 1,811 | py | Python | src/predictions/trainers/trainer.py | sqoshi/masked-face-recognizer | 40f66d776b203a1875200647b62d623f696d88a4 | [
"MIT"
] | null | null | null | src/predictions/trainers/trainer.py | sqoshi/masked-face-recognizer | 40f66d776b203a1875200647b62d623f696d88a4 | [
"MIT"
] | 11 | 2021-10-20T20:01:02.000Z | 2021-12-19T19:56:42.000Z | src/predictions/trainers/trainer.py | sqoshi/masked-face-recognizer | 40f66d776b203a1875200647b62d623f696d88a4 | [
"MIT"
] | null | null | null | import logging
import pickle
from abc import ABC, abstractmethod
from typing import Any, Dict, List, Optional, Union
from numpy.typing import NDArray
from sklearn.preprocessing import LabelEncoder
from predictions.face_recognizer import ModelType
from settings import output
logger = logging.getLogger(__name__)
def... | 32.927273 | 84 | 0.66317 | import logging
import pickle
from abc import ABC, abstractmethod
from typing import Any, Dict, List, Optional, Union
from numpy.typing import NDArray
from sklearn.preprocessing import LabelEncoder
from predictions.face_recognizer import ModelType
from settings import output
logger = logging.getLogger(__name__)
def... | true | true |
f748dcd871f3a356def80ca6bc57398b2b19614f | 244 | py | Python | tests/functional/conftest.py | SevanSSP/inquire-modeltest-sdk | 6d58bdec17d2c7039be0f58922efffba7691a176 | [
"MIT"
] | 4 | 2021-02-16T19:52:41.000Z | 2022-01-11T10:35:05.000Z | tests/functional/conftest.py | SevanSSP/inquire-modeltest-sdk | 6d58bdec17d2c7039be0f58922efffba7691a176 | [
"MIT"
] | 7 | 2021-02-16T19:35:28.000Z | 2021-12-10T11:46:52.000Z | tests/functional/conftest.py | SevanSSP/inquire-modeltest-sdk | 6d58bdec17d2c7039be0f58922efffba7691a176 | [
"MIT"
] | null | null | null | import pytest
from modeltestSDK import Client
@pytest.fixture(scope="module")
def client():
"""
Expose an SDK API client configured for testing
"""
client = Client() # TODO: Konfigurer en test API (lokalt?)
return client
| 20.333333 | 63 | 0.680328 | import pytest
from modeltestSDK import Client
@pytest.fixture(scope="module")
def client():
client = Client()
return client
| true | true |
f748dd36c3f1e6f285c84e343c3214106e20255d | 172 | py | Python | Projet9/review/admin.py | S0Imyr/Projet9 | 0717718e0878b49dac10aefc0901d94bd5ebebd0 | [
"MIT"
] | 1 | 2021-09-03T10:37:07.000Z | 2021-09-03T10:37:07.000Z | Projet9/review/admin.py | S0Imyr/Projet9 | 0717718e0878b49dac10aefc0901d94bd5ebebd0 | [
"MIT"
] | null | null | null | Projet9/review/admin.py | S0Imyr/Projet9 | 0717718e0878b49dac10aefc0901d94bd5ebebd0 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Ticket, Review, UserFollows
admin.site.register(Ticket)
admin.site.register(Review)
admin.site.register(UserFollows)
| 21.5 | 47 | 0.819767 | from django.contrib import admin
from .models import Ticket, Review, UserFollows
admin.site.register(Ticket)
admin.site.register(Review)
admin.site.register(UserFollows)
| true | true |
f748dd816e77fd10d9303d28f33fb543f57bb766 | 10 | py | Python | main.py | Tyranicangel/555 | a69abb505a10060cd40f92e81fb6496f3d7e3643 | [
"Unlicense"
] | null | null | null | main.py | Tyranicangel/555 | a69abb505a10060cd40f92e81fb6496f3d7e3643 | [
"Unlicense"
] | null | null | null | main.py | Tyranicangel/555 | a69abb505a10060cd40f92e81fb6496f3d7e3643 | [
"Unlicense"
] | null | null | null | #Main code | 10 | 10 | 0.8 | true | true | |
f748de04df7dfabeb50d21b1b45f39e5886d5f6a | 6,190 | py | Python | game.py | bronval/breakout_pygame | 7820d63cd65eabb6078615bdcc805bc847860211 | [
"MIT"
] | null | null | null | game.py | bronval/breakout_pygame | 7820d63cd65eabb6078615bdcc805bc847860211 | [
"MIT"
] | null | null | null | game.py | bronval/breakout_pygame | 7820d63cd65eabb6078615bdcc805bc847860211 | [
"MIT"
] | null | null | null |
#####################################################
#
# breakout game with pygame
# for Python stage in Technofutur TIC (Belgium)
# Authors : Bastien Wiaux and Benoit Ronval
#
#####################################################
import pygame
from constants import *
from player import Player
from b... | 34.775281 | 151 | 0.554927 |
self.stop_game = True
return
self.ball = Ball()
def check_collision(self):
self.collide_screen() # verifie la collision avec l'ecran
indices = self.collide_list_of_bricks()
for i, idx in enumerate(indices):
del(self.bricks[idx-i]... | true | true |
f748de971f3568f4ca5722428566f8d63007de7b | 2,473 | py | Python | pyqt-official/pyuic/compile-on-the-fly.py | a358003542/pyside2_examples | 5f337211e615a726541bf6766455d4f2c9d0f551 | [
"MIT"
] | 1 | 2020-02-11T08:22:28.000Z | 2020-02-11T08:22:28.000Z | pyqt-official/pyuic/compile-on-the-fly.py | a358003542/pyside2_examples | 5f337211e615a726541bf6766455d4f2c9d0f551 | [
"MIT"
] | null | null | null | pyqt-official/pyuic/compile-on-the-fly.py | a358003542/pyside2_examples | 5f337211e615a726541bf6766455d4f2c9d0f551 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2013 Riverbank Computing Limited.
## All rights reserved.
##
## This file is part of the examples of PyQt.
##
## You may use this file under the terms of the BSD license as follows:
##
## "Redistrib... | 36.367647 | 77 | 0.688637 | true | true | |
f748e0e629c51a839fd5e7e9590bedb4d1cc1e9d | 5,483 | py | Python | google/ads/googleads/v4/services/types/extension_feed_item_service.py | batardo/google-ads-python | a39748521847e85138fca593f3be2681352ad024 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v4/services/types/extension_feed_item_service.py | batardo/google-ads-python | a39748521847e85138fca593f3be2681352ad024 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v4/services/types/extension_feed_item_service.py | batardo/google-ads-python | a39748521847e85138fca593f3be2681352ad024 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 35.374194 | 140 | 0.692504 |
import proto
from google.ads.googleads.v4.resources.types import extension_feed_item
from google.protobuf import field_mask_pb2 as field_mask
from google.rpc import status_pb2 as status
__protobuf__ = proto.module(
package="google.ads.googleads.v4.services",
marshal="google.ads.google... | true | true |
f748e151620714b3bf085cffaa8015a060de619f | 3,050 | py | Python | huaweicloud-sdk-meeting/huaweicloudsdkmeeting/v1/model/show_sp_res_response.py | githubmilesma/huaweicloud-sdk-python-v3 | 9d9449ed68a609ca65f0aa50b5b2a1c28445bf03 | [
"Apache-2.0"
] | 1 | 2021-04-16T07:59:28.000Z | 2021-04-16T07:59:28.000Z | huaweicloud-sdk-meeting/huaweicloudsdkmeeting/v1/model/show_sp_res_response.py | Lencof/huaweicloud-sdk-python-v3 | d13dc4e2830a83e295be6e4de021999b3376e34e | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-meeting/huaweicloudsdkmeeting/v1/model/show_sp_res_response.py | Lencof/huaweicloud-sdk-python-v3 | d13dc4e2830a83e295be6e4de021999b3376e34e | [
"Apache-2.0"
] | 1 | 2022-01-17T02:24:18.000Z | 2022-01-17T02:24:18.000Z | # coding: utf-8
import pprint
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
class ShowSpResResponse(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): ... | 27.477477 | 86 | 0.574754 |
import pprint
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
class ShowSpResResponse(SdkResponse):
sensitive_list = []
openapi_types = {
'used_accounts_count': 'int'
}
attribute_map = {
'used_accounts_count': 'usedAccountsCount'
}
def __... | true | true |
f748e1ee43310bda1b925a33f07e367e3c328d9c | 618 | py | Python | contacts/migrations/0005_contact_company.py | renzyndrome/lits-crm | 32daea8c76f91780b8cc8c3f107d04df606c0ec8 | [
"MIT"
] | 1,334 | 2017-06-04T07:47:14.000Z | 2022-03-30T17:12:37.000Z | contacts/migrations/0005_contact_company.py | AhmedDoudou/Django-CRM-1 | 5faf22acb30aeb32f5830898fd5d8ecd1ac0bbd8 | [
"MIT"
] | 317 | 2017-06-04T07:48:13.000Z | 2022-03-29T19:24:26.000Z | contacts/migrations/0005_contact_company.py | AhmedDoudou/Django-CRM-1 | 5faf22acb30aeb32f5830898fd5d8ecd1ac0bbd8 | [
"MIT"
] | 786 | 2017-06-06T09:18:48.000Z | 2022-03-29T01:29:29.000Z | # Generated by Django 2.2.10 on 2020-04-23 10:29
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("common", "0020_auto_20200409_1653"),
("contacts", "0004_contact_teams"),
]
operations = [
migratio... | 23.769231 | 61 | 0.558252 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("common", "0020_auto_20200409_1653"),
("contacts", "0004_contact_teams"),
]
operations = [
migrations.AddField(
model_name="contact",
... | true | true |
f748e39e321ceab4f6f560a77a109e4c3328236e | 7,116 | py | Python | tsrc/cli/push_gitlab.py | tst2005/tsrc | af378db4950b3d557bc6839dcec2f0d0070f982e | [
"BSD-3-Clause"
] | null | null | null | tsrc/cli/push_gitlab.py | tst2005/tsrc | af378db4950b3d557bc6839dcec2f0d0070f982e | [
"BSD-3-Clause"
] | null | null | null | tsrc/cli/push_gitlab.py | tst2005/tsrc | af378db4950b3d557bc6839dcec2f0d0070f982e | [
"BSD-3-Clause"
] | null | null | null | """ Entry point for tsrc push """
import argparse
import itertools
from typing import cast, Any, List, Optional, Set # noqa
from gitlab import Gitlab
from gitlab.v4.objects import Group, User, Project, ProjectMergeRequest # noqa
from gitlab.exceptions import GitlabGetError
import ui
import tsrc
import tsrc.config... | 33.097674 | 93 | 0.627178 |
import argparse
import itertools
from typing import cast, Any, List, Optional, Set
from gitlab import Gitlab
from gitlab.v4.objects import Group, User, Project, ProjectMergeRequest
from gitlab.exceptions import GitlabGetError
import ui
import tsrc
import tsrc.config
import tsrc.gitlab
import tsrc.git
import tsr... | true | true |
f748e3f6be5429067c9e84388c7c7c4cf0d68d4b | 2,470 | py | Python | tests/api/endpoints/test_invitation.py | gzy403999903/seahub | 992e5852579a6d9e0cfdaf18c77ce0191cb64449 | [
"Apache-2.0"
] | null | null | null | tests/api/endpoints/test_invitation.py | gzy403999903/seahub | 992e5852579a6d9e0cfdaf18c77ce0191cb64449 | [
"Apache-2.0"
] | 6 | 2019-12-13T09:55:45.000Z | 2022-03-11T23:47:29.000Z | tests/api/endpoints/test_invitation.py | gzy403999903/seahub | 992e5852579a6d9e0cfdaf18c77ce0191cb64449 | [
"Apache-2.0"
] | 1 | 2019-05-16T06:58:16.000Z | 2019-05-16T06:58:16.000Z | import json
from mock import patch
from seahub.base.accounts import UserPermissions
from seahub.invitations.models import Invitation
from seahub.test_utils import BaseTestCase
from seahub.api2.permissions import CanInviteGuest
class InvitationsTest(BaseTestCase):
def setUp(self):
self.login_as(self.user)... | 34.305556 | 85 | 0.69919 | import json
from mock import patch
from seahub.base.accounts import UserPermissions
from seahub.invitations.models import Invitation
from seahub.test_utils import BaseTestCase
from seahub.api2.permissions import CanInviteGuest
class InvitationsTest(BaseTestCase):
def setUp(self):
self.login_as(self.user)... | true | true |
f748e41d7ce23f21f2c4caf504aff217d6701f26 | 3,104 | py | Python | pystac/iserv/footprint.py | lossyrob/pystac | 9f71e4ac3e14dae37f4b3a780825ac35ef8df063 | [
"Apache-2.0"
] | null | null | null | pystac/iserv/footprint.py | lossyrob/pystac | 9f71e4ac3e14dae37f4b3a780825ac35ef8df063 | [
"Apache-2.0"
] | null | null | null | pystac/iserv/footprint.py | lossyrob/pystac | 9f71e4ac3e14dae37f4b3a780825ac35ef8df063 | [
"Apache-2.0"
] | null | null | null | """Creates a data/tile footprint"""
import json
import logging
import os
import subprocess
import tempfile
import rasterio
from geojson import Polygon
from pystac.utils.io import get_tempdir
logger = logging.getLogger(__name__)
def generate_thumbnail(prefix: str, tif_path: str) -> str:
"""Generates thumbnail f... | 35.272727 | 89 | 0.628222 | import json
import logging
import os
import subprocess
import tempfile
import rasterio
from geojson import Polygon
from pystac.utils.io import get_tempdir
logger = logging.getLogger(__name__)
def generate_thumbnail(prefix: str, tif_path: str) -> str:
with get_tempdir() as temp_dir:
logger.info('Beginn... | true | true |
f748e49f1bf6381c9f448ef9f7ebb16942ab6910 | 17,795 | py | Python | openpyexcel/drawing/geometry.py | sciris/openpyexcel | 1fde667a1adc2f4988279fd73a2ac2660706b5ce | [
"MIT"
] | 2 | 2019-07-03T06:37:42.000Z | 2020-05-15T00:28:13.000Z | openpyexcel/drawing/geometry.py | sciris/openpyexcel | 1fde667a1adc2f4988279fd73a2ac2660706b5ce | [
"MIT"
] | null | null | null | openpyexcel/drawing/geometry.py | sciris/openpyexcel | 1fde667a1adc2f4988279fd73a2ac2660706b5ce | [
"MIT"
] | 1 | 2020-01-06T10:01:42.000Z | 2020-01-06T10:01:42.000Z | from __future__ import absolute_import
# Copyright (c) 2010-2019 openpyexcel
from openpyexcel.descriptors.serialisable import Serialisable
from openpyexcel.descriptors import (
Typed,
Float,
Integer,
Bool,
MinMax,
Set,
NoneSet,
String,
Alias,
)
from openpyexcel.descriptors.excel imp... | 29.80737 | 98 | 0.588648 | from __future__ import absolute_import
from openpyexcel.descriptors.serialisable import Serialisable
from openpyexcel.descriptors import (
Typed,
Float,
Integer,
Bool,
MinMax,
Set,
NoneSet,
String,
Alias,
)
from openpyexcel.descriptors.excel import Coordinate, Percentage
from open... | true | true |
f748e509a92580a64d8b6c31f9bc6a86ebac8b2a | 1,601 | py | Python | golden/go/diff/testdata/get_diffmetric.py | isabella232/skia-buildbot | 6bfdd3e57760c114fdd6b207a4a254e01c0579be | [
"BSD-3-Clause"
] | 119 | 2015-01-09T20:49:54.000Z | 2022-02-20T03:03:54.000Z | golden/go/diff/testdata/get_diffmetric.py | isabella232/skia-buildbot | 6bfdd3e57760c114fdd6b207a4a254e01c0579be | [
"BSD-3-Clause"
] | 74 | 2018-06-22T09:57:11.000Z | 2022-03-28T14:10:25.000Z | golden/go/diff/testdata/get_diffmetric.py | isabella232/skia-buildbot | 6bfdd3e57760c114fdd6b207a4a254e01c0579be | [
"BSD-3-Clause"
] | 55 | 2015-01-23T13:45:32.000Z | 2022-02-20T03:11:46.000Z | #!/usr/bin/env python
# Usage: get_diffmetric.py img1 img2
#
# Helper script that calculates the DiffMetric between two given images.
# For debugging purposes only.
#
# Note: This requires PIL or Pillow to be installed.
from __future__ import print_function
import sys
from PIL import Image
## Main program.
img1_pat... | 26.683333 | 75 | 0.657089 |
from __future__ import print_function
import sys
from PIL import Image
s.argv[1]
img2_path = sys.argv[2]
img1 = Image.open(img1_path)
img2 = Image.open(img2_path)
has_alpha = (img1.mode == img2.mode)
xMin = min(img1.size[0], img2.size[0])
yMin = min(img1.size[1], img2.size[1])
xMax = max(img1.size[0], img2... | true | true |
f748e51dcd1ea370eb197cbae823f26353bb34ee | 3,152 | py | Python | tests/transformers/test_feature_selector.py | awesome-archive/tsfresh | 9419aa15bb26a3725291f39636354e67c9b04caa | [
"MIT"
] | null | null | null | tests/transformers/test_feature_selector.py | awesome-archive/tsfresh | 9419aa15bb26a3725291f39636354e67c9b04caa | [
"MIT"
] | null | null | null | tests/transformers/test_feature_selector.py | awesome-archive/tsfresh | 9419aa15bb26a3725291f39636354e67c9b04caa | [
"MIT"
] | 1 | 2020-11-09T03:46:27.000Z | 2020-11-09T03:46:27.000Z | # -*- coding: utf-8 -*-
# This file as well as the whole tsfresh package are licenced under the MIT licence (see the LICENCE.txt)
# Maximilian Christ (maximilianchrist.com), Blue Yonder Gmbh, 2016
from unittest import TestCase
import pandas as pd
import numpy as np
from tsfresh.transformers.feature_selector import F... | 30.601942 | 106 | 0.607868 |
from unittest import TestCase
import pandas as pd
import numpy as np
from tsfresh.transformers.feature_selector import FeatureSelector
class FeatureSelectorTestCase(TestCase):
def setUp(self):
np.random.seed(0)
def test_not_fitted(self):
selector = FeatureSelector()
X = pd.Data... | true | true |
f748e5d885c37df326b84dec3eaa5a56bd27c4d1 | 4,724 | py | Python | test/Fortran/F90FLAGS.py | clemens-tolboom/scons | cd722bdc5f6b1163d56246ee0afc63c28ecc138e | [
"MIT"
] | null | null | null | test/Fortran/F90FLAGS.py | clemens-tolboom/scons | cd722bdc5f6b1163d56246ee0afc63c28ecc138e | [
"MIT"
] | null | null | null | test/Fortran/F90FLAGS.py | clemens-tolboom/scons | cd722bdc5f6b1163d56246ee0afc63c28ecc138e | [
"MIT"
] | null | null | null |
#!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,... | 35.253731 | 73 | 0.662574 |
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os
import TestSCons
_python_ = TestSCons._python_
test = TestSCons.TestSCons()
_exe = TestSCons._exe
test.file_fixture('mylink.py')
test.file_fixture(['fixture', 'myfortran_flags.py'])
test.write('SConstruct', """
env = E... | true | true |
f748e77bffc00146fa633b52180051925eb35b29 | 541 | py | Python | manage.py | eunjungleecub/jessica42 | 6bbf24226d1d42e029937d8055a4b18f2c075980 | [
"Apache-2.0"
] | 1 | 2019-11-11T22:58:15.000Z | 2019-11-11T22:58:15.000Z | manage.py | eunjungleecub/jessica42 | 6bbf24226d1d42e029937d8055a4b18f2c075980 | [
"Apache-2.0"
] | null | null | null | manage.py | eunjungleecub/jessica42 | 6bbf24226d1d42e029937d8055a4b18f2c075980 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'jessica42.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Ar... | 33.8125 | 73 | 0.687616 |
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'jessica42.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's insta... | true | true |
f748e7ac05858ec431163cdf6ff73d364a07d2f1 | 3,815 | py | Python | mis-bot/scraper/spiders/results_spider.py | bleeptrack/MIS-Bot | ae6eeec3f7f14fdbc2dfed4a1e58be70b253cdac | [
"MIT"
] | null | null | null | mis-bot/scraper/spiders/results_spider.py | bleeptrack/MIS-Bot | ae6eeec3f7f14fdbc2dfed4a1e58be70b253cdac | [
"MIT"
] | null | null | null | mis-bot/scraper/spiders/results_spider.py | bleeptrack/MIS-Bot | ae6eeec3f7f14fdbc2dfed4a1e58be70b253cdac | [
"MIT"
] | null | null | null | from os import environ
import base64
from multiprocessing import Process, Queue
from scrapy.spiders.init import InitSpider
from scrapy.http import Request, FormRequest
from scrapy_splash import SplashRequest
import scrapy.crawler as crawler
from twisted.internet import reactor
from ..captcha import captcha_solver
cla... | 40.585106 | 118 | 0.639843 | from os import environ
import base64
from multiprocessing import Process, Queue
from scrapy.spiders.init import InitSpider
from scrapy.http import Request, FormRequest
from scrapy_splash import SplashRequest
import scrapy.crawler as crawler
from twisted.internet import reactor
from ..captcha import captcha_solver
cla... | true | true |
f748e7e34ff5855e1ed6244238645c3a92f11b6f | 1,387 | py | Python | pyVmomi/Version.py | virtdevninja/pyvmomi-ce | c14de2e0cdcb891dbaaf59cd4da5ebbdb05f5f9e | [
"Apache-2.0"
] | 2 | 2015-09-09T16:31:26.000Z | 2015-09-10T06:39:53.000Z | pyVmomi/Version.py | x1unix/pyvmomi-playbook | 28f9b86c44e804442e71ddc882e6b59142f8932e | [
"Apache-2.0"
] | null | null | null | pyVmomi/Version.py | x1unix/pyvmomi-playbook | 28f9b86c44e804442e71ddc882e6b59142f8932e | [
"Apache-2.0"
] | null | null | null | # VMware vSphere Python SDK
# Copyright (c) 2008-2014 VMware, 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
#
# ... | 37.486486 | 89 | 0.71305 |
from __future__ import absolute_import
from pyVmomi.VmomiSupport import nsMap, versionMap, versionIdMap, serviceNsMap, parentMap
ion, ns, versionId='', isLegacy=0, serviceNs=''):
if not ns:
ns = serviceNs
if not (version in parentMap):
nsMap[version] = ns
if len(versionId) > 0:
... | true | true |
f748e8817a9b64a677b70926648ce6e2675299b7 | 12,923 | py | Python | modules.py | Xinghanzzy/transformer-simple | e34592c41829e2c35955fa38e802765116dc1c35 | [
"Apache-2.0"
] | null | null | null | modules.py | Xinghanzzy/transformer-simple | e34592c41829e2c35955fa38e802765116dc1c35 | [
"Apache-2.0"
] | null | null | null | modules.py | Xinghanzzy/transformer-simple | e34592c41829e2c35955fa38e802765116dc1c35 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#/usr/bin/python2
'''
June 2017 by kyubyong park.
kbpark.linguist@gmail.com.
https://www.github.com/kyubyong/transformer
'''
from __future__ import print_function
import tensorflow as tf
import numpy as np
def normalize(inputs,
epsilon = 1e-8,
scope="ln",
... | 35.797784 | 113 | 0.572003 |
from __future__ import print_function
import tensorflow as tf
import numpy as np
def normalize(inputs,
epsilon = 1e-8,
scope="ln",
reuse=None):
with tf.variable_scope(scope, reuse=reuse):
inputs_shape = inputs.get_shape()
params_shape = inputs_shape[-1:... | true | true |
f748e9fe959abf00c485cc72963079029d52f6bc | 702 | py | Python | tensorflow_datasets/structured/web_nlg/__init__.py | harsh020/datasets | b4ad3617b279ec65356e696c4c860458621976f6 | [
"Apache-2.0"
] | 1 | 2020-12-10T06:37:27.000Z | 2020-12-10T06:37:27.000Z | tensorflow_datasets/structured/web_nlg/__init__.py | Jinwook-shim/datasets | 815037e87150e3c8a557d91a68b07e8ffb6a2a86 | [
"Apache-2.0"
] | 1 | 2021-02-23T20:16:05.000Z | 2021-02-23T20:16:05.000Z | tensorflow_datasets/structured/web_nlg/__init__.py | Jinwook-shim/datasets | 815037e87150e3c8a557d91a68b07e8ffb6a2a86 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 36.947368 | 74 | 0.769231 |
from tensorflow_datasets.structured.web_nlg.web_nlg import WebNlg
| true | true |
f748eb8732a59f9b26a4269bda0b39fdf3774ed0 | 14,053 | py | Python | tests/test_integration_workflows.py | diazandr3s/MONAI | 209db9e08129855df878634639d4c2700d9acd83 | [
"Apache-2.0"
] | null | null | null | tests/test_integration_workflows.py | diazandr3s/MONAI | 209db9e08129855df878634639d4c2700d9acd83 | [
"Apache-2.0"
] | null | null | null | tests/test_integration_workflows.py | diazandr3s/MONAI | 209db9e08129855df878634639d4c2700d9acd83 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) MONAI Consortium
# 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, so... | 38.396175 | 115 | 0.653597 |
import os
import shutil
import tempfile
import unittest
import warnings
from glob import glob
import nibabel as nib
import numpy as np
import torch
from ignite.metrics import Accuracy
from torch.utils.tensorboard import SummaryWriter
import monai
from monai.data import create_test_image_3d
from monai.engin... | true | true |
f748ed91b13964e49ab424371d25909e85c1e72f | 1,686 | py | Python | tests/customConfig/arm_build_with_custom_config.py | goshow-jp/Kraken | 7088b474b6cc2840cea7ab642c5938e4a3290b6c | [
"BSD-3-Clause"
] | null | null | null | tests/customConfig/arm_build_with_custom_config.py | goshow-jp/Kraken | 7088b474b6cc2840cea7ab642c5938e4a3290b6c | [
"BSD-3-Clause"
] | null | null | null | tests/customConfig/arm_build_with_custom_config.py | goshow-jp/Kraken | 7088b474b6cc2840cea7ab642c5938e4a3290b6c | [
"BSD-3-Clause"
] | 1 | 2021-12-08T08:31:48.000Z | 2021-12-08T08:31:48.000Z |
from kraken import plugins
from kraken.core.maths import Xfo, Vec3, Quat
from kraken.core.configs.config import Config
from kraken_components.biped.arm_component import ArmComponentGuide, ArmComponentRig
class CustomConfig(Config):
"""Base Configuration for Kraken builders."""
def __init__(self):
s... | 25.938462 | 86 | 0.609727 |
from kraken import plugins
from kraken.core.maths import Xfo, Vec3, Quat
from kraken.core.configs.config import Config
from kraken_components.biped.arm_component import ArmComponentGuide, ArmComponentRig
class CustomConfig(Config):
def __init__(self):
super(CustomConfig, self).__init__()
... | true | true |
f748edbce51542056ecc0e94570f3ed1e7341b73 | 8,013 | py | Python | build-scripts/cpe_generate.py | caitelatte/content | e3d6f00f3e6fbd76cc66525f4ea36156a5bea7e2 | [
"BSD-3-Clause"
] | 1 | 2019-01-07T10:43:25.000Z | 2019-01-07T10:43:25.000Z | build-scripts/cpe_generate.py | caitelatte/content | e3d6f00f3e6fbd76cc66525f4ea36156a5bea7e2 | [
"BSD-3-Clause"
] | 1 | 2020-02-20T16:02:32.000Z | 2020-02-26T11:57:26.000Z | build-scripts/cpe_generate.py | caitelatte/content | e3d6f00f3e6fbd76cc66525f4ea36156a5bea7e2 | [
"BSD-3-Clause"
] | 1 | 2019-12-12T12:08:14.000Z | 2019-12-12T12:08:14.000Z | #!/usr/bin/env python2
from __future__ import print_function
import fnmatch
import sys
import os
import ssg
import argparse
import ssg.build_cpe
import ssg.id_translate
import ssg.xml
# This script requires two arguments: an OVAL file and a CPE dictionary file.
# It is designed to extract any inventory definitions ... | 44.516667 | 93 | 0.64645 |
from __future__ import print_function
import fnmatch
import sys
import os
import ssg
import argparse
import ssg.build_cpe
import ssg.id_translate
import ssg.xml
oval_ns = "http://oval.mitre.org/XMLSchema/oval-definitions-5"
xccdf_ns = "http://checklists.nist.gov/xccdf/1.1"
cpe_ns = "http://cpe.mitre.org/dicti... | true | true |
f748edd98940cce239560bfdf78570f0ecc45978 | 987 | py | Python | nikola/data/themes/base/messages/messages_tl.py | schettino72/nikola | d690d74f75abbf566c389d1ba3a53fac14b56d8f | [
"MIT"
] | null | null | null | nikola/data/themes/base/messages/messages_tl.py | schettino72/nikola | d690d74f75abbf566c389d1ba3a53fac14b56d8f | [
"MIT"
] | null | null | null | nikola/data/themes/base/messages/messages_tl.py | schettino72/nikola | d690d74f75abbf566c389d1ba3a53fac14b56d8f | [
"MIT"
] | null | null | null | # -*- encoding:utf-8 -*-
from __future__ import unicode_literals
MESSAGES = {
"%d min remaining to read": "",
"(active)": "",
"Also available in:": "",
"Archive": "",
"Categories": "",
"Comments": "",
"LANGUAGE": "Ingles",
"Languages:": "Mga Wika:",
"More posts about %s": "",
"N... | 24.675 | 42 | 0.480243 |
from __future__ import unicode_literals
MESSAGES = {
"%d min remaining to read": "",
"(active)": "",
"Also available in:": "",
"Archive": "",
"Categories": "",
"Comments": "",
"LANGUAGE": "Ingles",
"Languages:": "Mga Wika:",
"More posts about %s": "",
"Newer posts": "",
"Ne... | true | true |
f748eeb57b09b5447551729f821295aed52d3d61 | 427 | py | Python | backend/infrastructure/repository/mock/product.py | uesleicarvalhoo/Ecommerce | 1d8d0f0c522dcd27fd90e315989b6fa93caf62b8 | [
"MIT"
] | null | null | null | backend/infrastructure/repository/mock/product.py | uesleicarvalhoo/Ecommerce | 1d8d0f0c522dcd27fd90e315989b6fa93caf62b8 | [
"MIT"
] | null | null | null | backend/infrastructure/repository/mock/product.py | uesleicarvalhoo/Ecommerce | 1d8d0f0c522dcd27fd90e315989b6fa93caf62b8 | [
"MIT"
] | null | null | null | from typing import List
from backend.infrastructure.contracts import QueryProduct
from backend.infrastructure.schemas import ProductSchema
class MockProductRepository:
def select_one(self, query: QueryProduct) -> ProductSchema:
return None
def select_all(self, query: QueryProduct) -> List[ProductSch... | 26.6875 | 69 | 0.744731 | from typing import List
from backend.infrastructure.contracts import QueryProduct
from backend.infrastructure.schemas import ProductSchema
class MockProductRepository:
def select_one(self, query: QueryProduct) -> ProductSchema:
return None
def select_all(self, query: QueryProduct) -> List[ProductSch... | true | true |
f748f007ba7f0e2e57f1b930c2e06f52c7c3eebe | 1,068 | py | Python | ghtools/command/browse.py | alphagov/ghtools | be10c9251197c4c170e617f8328c1f94f5f45dca | [
"MIT"
] | 3 | 2015-02-09T12:19:40.000Z | 2016-07-20T18:19:11.000Z | ghtools/command/browse.py | alphagov/ghtools | be10c9251197c4c170e617f8328c1f94f5f45dca | [
"MIT"
] | 3 | 2015-02-06T13:39:31.000Z | 2016-10-03T09:33:33.000Z | ghtools/command/browse.py | alphagov/ghtools | be10c9251197c4c170e617f8328c1f94f5f45dca | [
"MIT"
] | 3 | 2017-10-12T10:33:20.000Z | 2021-04-10T19:55:50.000Z | from __future__ import print_function
import json
from argh import ArghParser, arg
from ghtools import cli
from ghtools.api import GithubAPIClient
parser = ArghParser(description="Browse the GitHub API")
@arg('github', nargs='?', help='GitHub instance nickname (e.g "enterprise")')
@arg('url', help='URL to browse')... | 26.04878 | 92 | 0.635768 | from __future__ import print_function
import json
from argh import ArghParser, arg
from ghtools import cli
from ghtools.api import GithubAPIClient
parser = ArghParser(description="Browse the GitHub API")
@arg('github', nargs='?', help='GitHub instance nickname (e.g "enterprise")')
@arg('url', help='URL to browse')... | true | true |
f748f01c30a28181bfb72e01d9874c42664e1a50 | 599 | py | Python | tests/test_scheme.py | Strubbl/map-machine | e2c6f8cd373bc5dba322129112cfa58874a8321b | [
"MIT"
] | 62 | 2021-09-18T02:37:03.000Z | 2022-03-21T22:58:35.000Z | tests/test_scheme.py | Strubbl/map-machine | e2c6f8cd373bc5dba322129112cfa58874a8321b | [
"MIT"
] | 52 | 2021-09-11T09:43:24.000Z | 2022-03-24T07:08:22.000Z | tests/test_scheme.py | Strubbl/map-machine | e2c6f8cd373bc5dba322129112cfa58874a8321b | [
"MIT"
] | 6 | 2021-10-13T07:27:21.000Z | 2022-02-10T03:57:29.000Z | """
Test scheme parsing.
"""
from map_machine.scheme import Scheme
def test_verification() -> None:
assert (
Scheme(
{
"colors": {"default": "#444444"},
"node_icons": [{"tags": [{"tags": {"a": "b"}}]}],
}
)
.node_matchers[0]
.... | 19.966667 | 65 | 0.382304 | from map_machine.scheme import Scheme
def test_verification() -> None:
assert (
Scheme(
{
"colors": {"default": "#444444"},
"node_icons": [{"tags": [{"tags": {"a": "b"}}]}],
}
)
.node_matchers[0]
.verify()
is True
... | true | true |
f748f05f817b7b62121b4eb129e41a358aa5f460 | 1,329 | py | Python | Basics/04 - while loop.py | Piraato/Learn-Python | ae33680b61bbf41f5c0c29c79544b54e59df80b2 | [
"MIT"
] | null | null | null | Basics/04 - while loop.py | Piraato/Learn-Python | ae33680b61bbf41f5c0c29c79544b54e59df80b2 | [
"MIT"
] | null | null | null | Basics/04 - while loop.py | Piraato/Learn-Python | ae33680b61bbf41f5c0c29c79544b54e59df80b2 | [
"MIT"
] | null | null | null | # The While Loop
monty = 0
python = 10
# While the value of monty is smaller than python's value
# everything within the loop will be executed
while monty < python:
print('Currently at: ' + str(monty))
# Python does not allow the increment operator: monty++ won't work
monty += 1
# A ... | 25.557692 | 113 | 0.638074 |
monty = 0
python = 10
# everything within the loop will be executed
while monty < python:
print('Currently at: ' + str(monty))
# Python does not allow the increment operator: monty++ won't work
monty += 1
name = ''
while name != 'ur name m8':
print('pls type ur name m8')
... | true | true |
f748f0f244c7abe02c4fc573604a463dd2aa2d5c | 6,188 | py | Python | objdump.py | vrjuliao/pyobjdump | fbfef9c7cda165c3475784d59674aa3f6c05fbd1 | [
"MIT"
] | null | null | null | objdump.py | vrjuliao/pyobjdump | fbfef9c7cda165c3475784d59674aa3f6c05fbd1 | [
"MIT"
] | null | null | null | objdump.py | vrjuliao/pyobjdump | fbfef9c7cda165c3475784d59674aa3f6c05fbd1 | [
"MIT"
] | null | null | null | import capstone as cp
from elftools.elf.elffile import ELFFile
import bisect
from diffObjdump import FunctionFeatures
class Objdump:
__local_code_begin = 0
__local_code_end = 0
__linked_code_begin = 0
__linked_code_end = 0
def __init__(self, filename):
self.__name = filename
with open(filename, 'rb'... | 39.666667 | 103 | 0.704913 | import capstone as cp
from elftools.elf.elffile import ELFFile
import bisect
from diffObjdump import FunctionFeatures
class Objdump:
__local_code_begin = 0
__local_code_end = 0
__linked_code_begin = 0
__linked_code_end = 0
def __init__(self, filename):
self.__name = filename
with open(filename, 'rb'... | true | true |
f748f106ec4e2305b9e94a1507273a54f37c396d | 10,813 | py | Python | sdk/servicebus/azure-servicebus/azure/servicebus/aio/async_message.py | anuchandy/azure-sdk-for-python | 589b9890554ebf261aa2184e8f1c6507f01a207c | [
"MIT"
] | null | null | null | sdk/servicebus/azure-servicebus/azure/servicebus/aio/async_message.py | anuchandy/azure-sdk-for-python | 589b9890554ebf261aa2184e8f1c6507f01a207c | [
"MIT"
] | null | null | null | sdk/servicebus/azure-servicebus/azure/servicebus/aio/async_message.py | anuchandy/azure-sdk-for-python | 589b9890554ebf261aa2184e8f1c6507f01a207c | [
"MIT"
] | null | null | null | # ------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# -------------------------------------------------------------------------
import date... | 48.272321 | 113 | 0.689078 |
import datetime
import functools
from azure.servicebus.common import message
from azure.servicebus.common.utils import get_running_loop
from azure.servicebus.common.errors import MessageSettleFailed
from azure.servicebus.common.constants import DEADLETTERNAME
class Message(message.Message):
def __init__(s... | true | true |
f748f15c17ba17d7913883500106cb7800d7447f | 3,779 | py | Python | src/sima/riflex/sumforceresponsestorage.py | SINTEF/simapy | 650b8c2f15503dad98e2bfc0d0788509593822c7 | [
"MIT"
] | null | null | null | src/sima/riflex/sumforceresponsestorage.py | SINTEF/simapy | 650b8c2f15503dad98e2bfc0d0788509593822c7 | [
"MIT"
] | null | null | null | src/sima/riflex/sumforceresponsestorage.py | SINTEF/simapy | 650b8c2f15503dad98e2bfc0d0788509593822c7 | [
"MIT"
] | null | null | null | # This an autogenerated file
#
# Generated with SumForceResponseStorage
from typing import Dict,Sequence,List
from dmt.entity import Entity
from dmt.blueprint import Blueprint
from .blueprints.sumforceresponsestorage import SumForceResponseStorageBlueprint
from typing import Dict
from sima.riflex.additionalfileformatc... | 29.992063 | 129 | 0.643027 |
from typing import Dict,Sequence,List
from dmt.entity import Entity
from dmt.blueprint import Blueprint
from .blueprints.sumforceresponsestorage import SumForceResponseStorageBlueprint
from typing import Dict
from sima.riflex.additionalfileformatcode import AdditionalFileFormatCode
from sima.riflex.elementreference ... | true | true |
f748f1958033da09055407d50c39349cb1e4fe5d | 382 | py | Python | slot/migrations/0002_remove_request_approved.py | bibhasmondal/slot_allocation | 8415ec091e66a800dcedefe551ba244dede9c9e9 | [
"MIT"
] | null | null | null | slot/migrations/0002_remove_request_approved.py | bibhasmondal/slot_allocation | 8415ec091e66a800dcedefe551ba244dede9c9e9 | [
"MIT"
] | null | null | null | slot/migrations/0002_remove_request_approved.py | bibhasmondal/slot_allocation | 8415ec091e66a800dcedefe551ba244dede9c9e9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-07-01 05:05
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('slot', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_... | 19.1 | 48 | 0.602094 |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('slot', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='request',
name='approved',
),
]
| true | true |
f748f29d0ca6bbd9b86ef40b93e96903a21c6116 | 2,456 | py | Python | dataset/kaggle.py | sirmarcel/cmlkit-examples | fe9d15b16095af2730875dc9a98d2918eede6f5e | [
"MIT"
] | null | null | null | dataset/kaggle.py | sirmarcel/cmlkit-examples | fe9d15b16095af2730875dc9a98d2918eede6f5e | [
"MIT"
] | null | null | null | dataset/kaggle.py | sirmarcel/cmlkit-examples | fe9d15b16095af2730875dc9a98d2918eede6f5e | [
"MIT"
] | null | null | null | import qmmlpack as qmml
import numpy as np
import ase.io as asio
import csv
from cmlkit.dataset import Dataset, Subset
import cmlkit.indices as cmli
# The following assumes that you have downloaded the Kaggle dataset from
# https://www.kaggle.com/c/nomad2018-predict-transparent-conductors/data,
# in particular train.c... | 29.590361 | 119 | 0.693811 | import qmmlpack as qmml
import numpy as np
import ase.io as asio
import csv
from cmlkit.dataset import Dataset, Subset
import cmlkit.indices as cmli
z = []
r = []
b = []
for i in range(2400):
f = 'train/{}/geometry.xyz'.format(i + 1)
structure = asio.read(f, format='aims')
z.append(structure.nu... | true | true |
f748f2c949ac305e8834dce539f101b3e06cbc0d | 3,772 | py | Python | validate.py | scovetta/Project-Security-Reviews | e21300ac7fc118f7b36099282c38e6998a174744 | [
"Apache-2.0"
] | null | null | null | validate.py | scovetta/Project-Security-Reviews | e21300ac7fc118f7b36099282c38e6998a174744 | [
"Apache-2.0"
] | 1 | 2021-02-09T22:12:23.000Z | 2021-02-09T22:12:23.000Z | validate.py | scovetta/Project-Security-Reviews | e21300ac7fc118f7b36099282c38e6998a174744 | [
"Apache-2.0"
] | 2 | 2021-02-09T20:10:37.000Z | 2021-02-09T21:57:57.000Z | #!env python
import sys
from typing import List
import os
import re
from better_profanity import profanity
class SecurityReviewValidator:
results = None
def __init__(self):
pass
def validate_path(self, path: str) -> List[str]:
results = []
for root, _, files in os.walk(path, topd... | 32.517241 | 128 | 0.566278 |
import sys
from typing import List
import os
import re
from better_profanity import profanity
class SecurityReviewValidator:
results = None
def __init__(self):
pass
def validate_path(self, path: str) -> List[str]:
results = []
for root, _, files in os.walk(path, topdown=False):
... | true | true |
f748f37d68d2e11bb2e0ff359cd1df4633cf0d23 | 51,569 | py | Python | src/rsc_rc.py | mjbonnington/uistyle | f2102e408a9ba6aa7cc7f37ec3f4a4d3bf134b10 | [
"MIT"
] | null | null | null | src/rsc_rc.py | mjbonnington/uistyle | f2102e408a9ba6aa7cc7f37ec3f4a4d3bf134b10 | [
"MIT"
] | null | null | null | src/rsc_rc.py | mjbonnington/uistyle | f2102e408a9ba6aa7cc7f37ec3f4a4d3bf134b10 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.9.1)
#
# WARNING! All changes made in this file will be lost!
from Qt import QtCore
qt_resource_data = b"\
\x00\x00\x00\x74\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x1f\x00\x... | 55.629989 | 129 | 0.724001 |
from Qt import QtCore
qt_resource_data = b"\
\x00\x00\x00\x74\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x1f\x00\x00\x00\x1f\x08\x06\x00\x00\x00\x1f\xae\x16\x39\
\x00\x00\x00\x3b\x49\x44\x41\x54\x48\x89\xed\xd5\xb1\x0d\x00\x20\
\x0c\x03\x41\x87\x61\xb3\x93\xa7\x85\x26\x13... | true | true |
f748f46f61effad2f3d6e553fcb9f5558ebd0202 | 663 | py | Python | normal_forms/examples/normal_form/for_plotting.py | joepatmckenna/normal_forms | e506304295a2592cfc050a2a688add89715aa5ff | [
"MIT"
] | null | null | null | normal_forms/examples/normal_form/for_plotting.py | joepatmckenna/normal_forms | e506304295a2592cfc050a2a688add89715aa5ff | [
"MIT"
] | null | null | null | normal_forms/examples/normal_form/for_plotting.py | joepatmckenna/normal_forms | e506304295a2592cfc050a2a688add89715aa5ff | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
def before_and_after(f, h, x_min=-1, x_max=1, y_min=-1, y_max=1):
fig, ax = plt.subplots(1, 2, figsize=(8, 3))
x = np.linspace(x_min, x_max, 500)
y = np.linspace(y_min, y_max, 500)
X, Y = np.meshgrid(x, y)
Z = np.array([[f(xi, yi) for xi in x] fo... | 30.136364 | 65 | 0.511312 | import matplotlib.pyplot as plt
import numpy as np
def before_and_after(f, h, x_min=-1, x_max=1, y_min=-1, y_max=1):
fig, ax = plt.subplots(1, 2, figsize=(8, 3))
x = np.linspace(x_min, x_max, 500)
y = np.linspace(y_min, y_max, 500)
X, Y = np.meshgrid(x, y)
Z = np.array([[f(xi, yi) for xi in x] fo... | true | true |
f748f4cb1125fe5e10f52dac54c2c85b4e6a8f47 | 2,017 | py | Python | src/leetcode_2078_two_furthest_houses_with_different_colors.py | yurirocha15/coding_practice | 952506932c47414da689454853ee745637413160 | [
"MIT"
] | 2 | 2020-12-08T13:59:10.000Z | 2021-05-01T05:07:39.000Z | src/leetcode_2078_two_furthest_houses_with_different_colors.py | yurirocha15/coding_practice | 952506932c47414da689454853ee745637413160 | [
"MIT"
] | null | null | null | src/leetcode_2078_two_furthest_houses_with_different_colors.py | yurirocha15/coding_practice | 952506932c47414da689454853ee745637413160 | [
"MIT"
] | 1 | 2021-05-02T17:42:02.000Z | 2021-05-02T17:42:02.000Z | # @l2g 2078 python3
# [2078] Two Furthest Houses With Different Colors
# Difficulty: Easy
# https://leetcode.com/problems/two-furthest-houses-with-different-colors
#
# There are n houses evenly lined up on the street,and each house is beautifully painted.
# You are given a 0-indexed integer array colors of length n,
# ... | 31.030769 | 101 | 0.68121 |
from typing import List
class Solution:
def maxDistance(self, colors: List[int]) -> int:
for i in range(len(colors)):
if colors[i] != colors[-1] or colors[0] != colors[-1 - i]:
return len(colors) - i - 1
return 1
if __nam... | true | true |
f748f71f2f2b7fe0e5abe428f08d42aa07cdf815 | 1,604 | py | Python | crossbuild/crossbuildmain.py | smohantty/tbuild | 7afaf13922314fc17daa31bc03871647593258ce | [
"MIT"
] | null | null | null | crossbuild/crossbuildmain.py | smohantty/tbuild | 7afaf13922314fc17daa31bc03871647593258ce | [
"MIT"
] | null | null | null | crossbuild/crossbuildmain.py | smohantty/tbuild | 7afaf13922314fc17daa31bc03871647593258ce | [
"MIT"
] | null | null | null |
import sys
import os
import argparse
import subprocess
class CommandLineParser:
def __init__(self):
self.term_width = 100
self.formater = lambda prog: argparse.HelpFormatter(prog, max_help_position=int(self.term_width / 2), width=self.term_width)
self.commands = {}
self.hidden_comm... | 29.703704 | 132 | 0.644638 |
import sys
import os
import argparse
import subprocess
class CommandLineParser:
def __init__(self):
self.term_width = 100
self.formater = lambda prog: argparse.HelpFormatter(prog, max_help_position=int(self.term_width / 2), width=self.term_width)
self.commands = {}
self.hidden_comm... | true | true |
f748f77a0bd7f441d426554bfa471279ec8f164f | 5,826 | py | Python | remove-dead-domains.py | desbma/referer-spam-domains-blacklist | 7f29f0016e780dd0f7f436e64de0159cb7291282 | [
"WTFPL"
] | 19 | 2015-11-25T14:28:22.000Z | 2021-11-11T22:57:12.000Z | remove-dead-domains.py | desbma/referer-spam-domains-blacklist | 7f29f0016e780dd0f7f436e64de0159cb7291282 | [
"WTFPL"
] | 13 | 2015-11-17T21:24:44.000Z | 2020-10-18T20:08:36.000Z | remove-dead-domains.py | desbma/referer-spam-domains-blacklist | 7f29f0016e780dd0f7f436e64de0159cb7291282 | [
"WTFPL"
] | 10 | 2015-09-11T02:19:38.000Z | 2020-08-07T04:47:13.000Z | #!/usr/bin/env python3
""" Remove dead domains from list. """
import argparse
import asyncio
import collections
import errno
import itertools
import random
import resource
from typing import Dict, List, Optional
import aiodns
import tqdm
DNS_SERVERS = (
("8.8.8.8", "8.8.4.4"), # Google DNS
("208.67.222.222... | 35.962963 | 117 | 0.646584 |
import argparse
import asyncio
import collections
import errno
import itertools
import random
import resource
from typing import Dict, List, Optional
import aiodns
import tqdm
DNS_SERVERS = (
("8.8.8.8", "8.8.4.4"),
("208.67.222.222", "208.67.220.220"),
("84.200.69.80", "84.200.70.40"),
("209... | true | true |
f748f805b62cd8213b26cf4d71000e9f6d25f634 | 598 | py | Python | metecho/api/migrations/0098_add_task_assignee_ids.py | VaccineCloud/Metecho-Vax | 48762a2b5bb53d0d5633d1871e4f1451f5e3e91c | [
"BSD-3-Clause"
] | 21 | 2020-04-02T21:39:58.000Z | 2022-01-31T19:43:47.000Z | metecho/api/migrations/0098_add_task_assignee_ids.py | VaccineCloud/Metecho-Vax | 48762a2b5bb53d0d5633d1871e4f1451f5e3e91c | [
"BSD-3-Clause"
] | 1,613 | 2020-03-26T16:39:57.000Z | 2022-03-07T14:54:16.000Z | metecho/api/migrations/0098_add_task_assignee_ids.py | oddbird/MetaShare | 71fb667eaea6990e9d89be13d9a47e76db2a6c46 | [
"BSD-3-Clause"
] | 21 | 2020-07-21T11:58:47.000Z | 2021-11-25T00:48:21.000Z | # Generated by Django 3.2 on 2021-04-20 21:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("api", "0097_githubrepository_permissions"),
]
operations = [
migrations.AddField(
model_name="task",
name="assigned_de... | 24.916667 | 73 | 0.59699 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("api", "0097_githubrepository_permissions"),
]
operations = [
migrations.AddField(
model_name="task",
name="assigned_dev_id",
field=models.CharField(bla... | true | true |
f748f82be9f660d66159d93738a19e8cde5ffeaa | 3,899 | py | Python | pyscf/symm/test/test_Dmatrix.py | QuESt-Calculator/pyscf | 0ed03633b699505c7278f1eb501342667d0aa910 | [
"Apache-2.0"
] | 501 | 2018-12-06T23:48:17.000Z | 2022-03-31T11:53:18.000Z | pyscf/symm/test/test_Dmatrix.py | QuESt-Calculator/pyscf | 0ed03633b699505c7278f1eb501342667d0aa910 | [
"Apache-2.0"
] | 710 | 2018-11-26T22:04:52.000Z | 2022-03-30T03:53:12.000Z | pyscf/symm/test/test_Dmatrix.py | QuESt-Calculator/pyscf | 0ed03633b699505c7278f1eb501342667d0aa910 | [
"Apache-2.0"
] | 273 | 2018-11-26T10:10:24.000Z | 2022-03-30T12:25:28.000Z | #!/usr/bin/env python
# Copyright 2014-2019 The PySCF Developers. 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
#
# U... | 43.808989 | 99 | 0.606053 |
from functools import reduce
import unittest
import numpy
from pyscf import gto, lib
from pyscf.symm import Dmatrix, geom
class KnownValues(unittest.TestCase):
def test_Dmatrix(self):
self.assertAlmostEqual(lib.finger(Dmatrix.Dmatrix(0, -.7, .5, .2)), 1, 12)
self.assertAlmostEqual(l... | true | true |
f748f83319e575c96bb8c9a4c6cb38719a0a9590 | 1,335 | py | Python | code/linear_dates_only.py | zygmuntz/project-rhubarb | d12fbdcdff817710c072f2e3128aae3a641c10ff | [
"BSD-2-Clause"
] | 10 | 2017-05-22T14:35:30.000Z | 2019-05-06T16:31:27.000Z | code/linear_dates_only.py | zygmuntz/project-rhubarb | d12fbdcdff817710c072f2e3128aae3a641c10ff | [
"BSD-2-Clause"
] | null | null | null | code/linear_dates_only.py | zygmuntz/project-rhubarb | d12fbdcdff817710c072f2e3128aae3a641c10ff | [
"BSD-2-Clause"
] | 5 | 2017-09-29T18:42:13.000Z | 2020-01-15T08:09:51.000Z | #!/usr/bin/env python
"the benchmark with date features only"
"0.30421 on public leaderboard"
import numpy as np
import pandas as pd
from sklearn.linear_model import LinearRegression
#
train_file = '../data/train.csv'
test_file = '../data/test.csv'
output_file = 'linear_regression_with_date_features_only.csv'
lo... | 21.885246 | 80 | 0.710861 |
import numpy as np
import pandas as pd
from sklearn.linear_model import LinearRegression
train_file = '../data/train.csv'
test_file = '../data/test.csv'
output_file = 'linear_regression_with_date_features_only.csv'
log_transform = True
train = pd.read_csv( train_file, parse_dates = [ 'date' ])
test = pd.rea... | true | true |
f748f87a5e0c09a04600ca0fe807352ab64d396e | 2,009 | py | Python | fetch/country.py | itzmeanjan/country | aa6a02e1ebc459aad3556a0c94cec50a2ba23f6e | [
"MIT"
] | 4 | 2019-07-08T08:09:59.000Z | 2019-07-16T10:55:12.000Z | fetch/country.py | itzmeanjan/country | aa6a02e1ebc459aad3556a0c94cec50a2ba23f6e | [
"MIT"
] | 1 | 2019-07-01T08:44:14.000Z | 2019-07-10T09:54:24.000Z | fetch/country.py | itzmeanjan/country | aa6a02e1ebc459aad3556a0c94cec50a2ba23f6e | [
"MIT"
] | 1 | 2019-07-10T07:29:25.000Z | 2019-07-10T07:29:25.000Z | #!/usr/bin/python3
from __future__ import annotations
from typing import Dict
from requests import get
from json import dumps
from os.path import join, abspath, dirname, exists, realpath
from os import mkdir
def build(target_file: str = abspath(join(dirname(realpath(__file__)), '../data/country.json'))) -> Dict[str,... | 42.744681 | 584 | 0.610752 |
from __future__ import annotations
from typing import Dict
from requests import get
from json import dumps
from os.path import join, abspath, dirname, exists, realpath
from os import mkdir
def build(target_file: str = abspath(join(dirname(realpath(__file__)), '../data/country.json'))) -> Dict[str, str]:
code = ... | true | true |
f748f8bcb06390a7f7ae3dd28b5cc9156b22e54b | 4,277 | py | Python | pysc2/maps/lib.py | zeuseyera/pysc2 | df837baa43afd486d9f70a83c64bf12ff1962781 | [
"Apache-2.0"
] | 21 | 2018-12-27T05:04:49.000Z | 2021-05-20T16:20:32.000Z | pysc2/maps/lib.py | paraskuk/pysc2 | a9f093493c4c77adb385602790a480e7f238b97d | [
"Apache-2.0"
] | 1 | 2021-12-08T04:09:49.000Z | 2021-12-08T04:09:49.000Z | pysc2/maps/lib.py | paraskuk/pysc2 | a9f093493c4c77adb385602790a480e7f238b97d | [
"Apache-2.0"
] | 13 | 2019-01-02T08:35:45.000Z | 2021-02-23T20:55:02.000Z | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 31.218978 | 80 | 0.692308 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl import logging
import os
class DuplicateMapException(Exception):
pass
class NoMapException(Exception):
pass
class Map(object):
directory = ""
filename = None
download = N... | true | true |
f748f8ee3cc1f09a4b14cdc557e9924839cfc02b | 1,160 | py | Python | presidio-analyzer/tests/test_entity_recognizer.py | teamlumos/presidio | 1044495f41ea8bf6d1b1339bcddcbb46c2fe4de1 | [
"MIT"
] | 3 | 2020-12-30T15:27:26.000Z | 2021-02-04T17:20:28.000Z | presidio-analyzer/tests/test_entity_recognizer.py | DeepHiveMind/AI_powered_PII-Protection-and-Anonymization_Image-Text_Service | d658394078fec2fc3ebe70bd68af82c72e4c6388 | [
"MIT"
] | null | null | null | presidio-analyzer/tests/test_entity_recognizer.py | DeepHiveMind/AI_powered_PII-Protection-and-Anonymization_Image-Text_Service | d658394078fec2fc3ebe70bd68af82c72e4c6388 | [
"MIT"
] | 1 | 2019-12-05T14:01:27.000Z | 2019-12-05T14:01:27.000Z | from presidio_analyzer import EntityRecognizer
def test_to_dict_correct_dictionary():
ent_recognizer = EntityRecognizer(["ENTITY"])
entity_rec_dict = ent_recognizer.to_dict()
assert entity_rec_dict is not None
assert entity_rec_dict["supported_entities"] == ["ENTITY"]
assert entity_rec_dict["supp... | 34.117647 | 86 | 0.681897 | from presidio_analyzer import EntityRecognizer
def test_to_dict_correct_dictionary():
ent_recognizer = EntityRecognizer(["ENTITY"])
entity_rec_dict = ent_recognizer.to_dict()
assert entity_rec_dict is not None
assert entity_rec_dict["supported_entities"] == ["ENTITY"]
assert entity_rec_dict["supp... | true | true |
f748fa545213e635ff3f16b17cbdbc1d8f7dc1ff | 4,550 | py | Python | picard/_tools.py | arnodelorme/picard | f8fb90c2bd2e21087e565da186664c4e54626e41 | [
"BSD-3-Clause"
] | 1 | 2021-03-26T04:01:47.000Z | 2021-03-26T04:01:47.000Z | picard/_tools.py | arnodelorme/picard | f8fb90c2bd2e21087e565da186664c4e54626e41 | [
"BSD-3-Clause"
] | null | null | null | picard/_tools.py | arnodelorme/picard | f8fb90c2bd2e21087e565da186664c4e54626e41 | [
"BSD-3-Clause"
] | null | null | null | # Authors: Pierre Ablin <pierre.ablin@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Jean-Francois Cardoso <cardoso@iap.fr>
#
# License: BSD (3-clause)
import numbers
import numpy as np
from scipy.linalg import expm
def gradient(Y, psiY):
'''
Compute the gradient for the cu... | 27.245509 | 78 | 0.572527 |
import numbers
import numpy as np
from scipy.linalg import expm
def gradient(Y, psiY):
_, T = Y.shape
return np.inner(psiY, Y) / float(T)
def proj_hessian_approx(Y, psidY_mean, G):
N, _ = Y.shape
diag = psidY_mean[:, None] * np.ones(N)[None, :]
off_diag = np.diag(G)
return 0.5 * (diag... | true | true |
f748fa825deefacd9a81314dee7c08a7e7cbf7cc | 18,062 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_hub_bgp_connection_operations.py | praveenkuttappan/azure-sdk-for-python | 4b79413667b7539750a6c7dde15737013a3d4bd5 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_hub_bgp_connection_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_virtual_hub_bgp_connection_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 50.593838 | 223 | 0.678995 |
from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport impo... | true | true |
f748fa9a0c4b7013d25d2ad232eeaaee81f62647 | 339 | py | Python | aliyun/api/rest/Mts20140618QueryAnalysisJobListRequest.py | francisar/rds_manager | 458298669bf7d1990a85648b466b88f905256690 | [
"MIT"
] | 14 | 2015-11-30T02:35:18.000Z | 2019-05-14T11:49:24.000Z | aliyun/api/rest/Mts20140618QueryAnalysisJobListRequest.py | francisar/rds_manager | 458298669bf7d1990a85648b466b88f905256690 | [
"MIT"
] | 2 | 2015-11-30T02:51:40.000Z | 2017-03-16T01:51:45.000Z | aliyun/api/rest/Mts20140618QueryAnalysisJobListRequest.py | francisar/rds_manager | 458298669bf7d1990a85648b466b88f905256690 | [
"MIT"
] | 12 | 2016-01-04T06:48:17.000Z | 2020-11-07T14:08:25.000Z | '''
Created by auto_sdk on 2015.06.23
'''
from aliyun.api.base import RestApi
class Mts20140618QueryAnalysisJobListRequest(RestApi):
def __init__(self,domain='mts.aliyuncs.com',port=80):
RestApi.__init__(self,domain, port)
self.AnalysisJobIds = None
def getapiname(self):
return 'mts.aliyuncs.com.QueryAnalysisJ... | 28.25 | 59 | 0.778761 | from aliyun.api.base import RestApi
class Mts20140618QueryAnalysisJobListRequest(RestApi):
def __init__(self,domain='mts.aliyuncs.com',port=80):
RestApi.__init__(self,domain, port)
self.AnalysisJobIds = None
def getapiname(self):
return 'mts.aliyuncs.com.QueryAnalysisJobList.2014-06-18'
| true | true |
f748fb0673812365c15b6a5ca989e6715202ca3b | 189 | py | Python | 10/10.3/write_file.py | singi2016cn/python-scaffold | 274e508d1919da67e599aa73be139800c043bce4 | [
"MIT"
] | null | null | null | 10/10.3/write_file.py | singi2016cn/python-scaffold | 274e508d1919da67e599aa73be139800c043bce4 | [
"MIT"
] | null | null | null | 10/10.3/write_file.py | singi2016cn/python-scaffold | 274e508d1919da67e599aa73be139800c043bce4 | [
"MIT"
] | null | null | null | """写入文件"""
file_name = 'user_input.txt'
user_input = input('请输入您要存储的信息:\n')
with open(file_name, 'w',encoding='utf8') as file_object:
file_object.write(user_input)
print('写入成功')
| 18.9 | 57 | 0.687831 |
file_name = 'user_input.txt'
user_input = input('请输入您要存储的信息:\n')
with open(file_name, 'w',encoding='utf8') as file_object:
file_object.write(user_input)
print('写入成功')
| true | true |
f748fcb43c71f51f839698ed866aff8e7681fab0 | 913 | py | Python | connectorx-python/connectorx/tests/test_polars.py | ives9638/connector-x | be3817fa0b140aa5cfef825dced15b943fa2ddf0 | [
"MIT"
] | 565 | 2021-04-15T21:13:16.000Z | 2022-03-31T22:38:59.000Z | connectorx-python/connectorx/tests/test_polars.py | ives9638/connector-x | be3817fa0b140aa5cfef825dced15b943fa2ddf0 | [
"MIT"
] | 111 | 2021-04-13T05:55:23.000Z | 2022-03-31T17:50:13.000Z | connectorx-python/connectorx/tests/test_polars.py | ives9638/connector-x | be3817fa0b140aa5cfef825dced15b943fa2ddf0 | [
"MIT"
] | 41 | 2021-04-14T18:57:05.000Z | 2022-03-19T22:10:44.000Z | import os
import pandas as pd
import pytest
import polars as pl
from .. import read_sql
@pytest.fixture(scope="module") # type: ignore
def postgres_url() -> str:
conn = os.environ["POSTGRES_URL"]
return conn
def test_modin(postgres_url: str) -> None:
query = "SELECT * FROM test_table"
df = read_s... | 23.410256 | 64 | 0.555312 | import os
import pandas as pd
import pytest
import polars as pl
from .. import read_sql
@pytest.fixture(scope="module")
def postgres_url() -> str:
conn = os.environ["POSTGRES_URL"]
return conn
def test_modin(postgres_url: str) -> None:
query = "SELECT * FROM test_table"
df = read_sql(
po... | true | true |
f748fd635f7d5ffeb48a27e7b9a467e16bcd773c | 4,001 | py | Python | via/config_extractor.py | SenseTW/via | 17e2865b0f7a3771ac2031cc8b2bee432aec8209 | [
"MIT"
] | null | null | null | via/config_extractor.py | SenseTW/via | 17e2865b0f7a3771ac2031cc8b2bee432aec8209 | [
"MIT"
] | null | null | null | via/config_extractor.py | SenseTW/via | 17e2865b0f7a3771ac2031cc8b2bee432aec8209 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import logging
from urllib import urlencode
from urlparse import parse_qsl, urlparse, urlunparse
def rewrite_location_header(name, value, params):
"""
Rewrite "Location" header to append params to the URL's query string.
Returns other headers unmodified.
:par... | 34.791304 | 93 | 0.659835 | from __future__ import unicode_literals
import logging
from urllib import urlencode
from urlparse import parse_qsl, urlparse, urlunparse
def rewrite_location_header(name, value, params):
if name.lower() != 'location':
return (name, value)
try:
parsed_url = urlparse(value)
parsed_que... | true | true |
f748fdc731195e145279701eecbc7fdacc79b82a | 9,994 | py | Python | ml_debiaser/randomized_threshold.py | pedersor/google-research | 6fa751dd261b3f6d918fd2cd35efef5d8bf3eea6 | [
"Apache-2.0"
] | 1 | 2022-03-30T07:14:49.000Z | 2022-03-30T07:14:49.000Z | ml_debiaser/randomized_threshold.py | pedersor/google-research | 6fa751dd261b3f6d918fd2cd35efef5d8bf3eea6 | [
"Apache-2.0"
] | null | null | null | ml_debiaser/randomized_threshold.py | pedersor/google-research | 6fa751dd261b3f6d918fd2cd35efef5d8bf3eea6 | [
"Apache-2.0"
] | 1 | 2022-03-30T07:20:29.000Z | 2022-03-30T07:20:29.000Z | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 38.291188 | 80 | 0.655493 |
import math
import numpy as np
class RandomizedThreshold:
def __init__(self, gamma=1.0, eps=0.0, rho=None):
if eps < 0:
raise ValueError('eps must be non-negative.')
if gamma <= 0:
raise ValueError('gamma must be a strictly positive number.')
if rho is not None and rho <=... | true | true |
f748fdeb78bad0f24cba9a8e5dbd3c43fbb7b9ec | 3,385 | py | Python | dayonetools/services/__init__.py | durden/dayonetools | ff1a0a5378a17db96fa4a837042b3e2d21c1d6c6 | [
"MIT"
] | 9 | 2015-02-09T19:19:09.000Z | 2017-12-07T04:37:08.000Z | dayonetools/services/__init__.py | durden/dayonetools | ff1a0a5378a17db96fa4a837042b3e2d21c1d6c6 | [
"MIT"
] | null | null | null | dayonetools/services/__init__.py | durden/dayonetools | ff1a0a5378a17db96fa4a837042b3e2d21c1d6c6 | [
"MIT"
] | null | null | null | # -*- mode: python; coding: utf-8; -*-
"""Common services code"""
import os
AVAILABLE_SERVICES = ['habit_list', 'idonethis', 'nikeplus', 'pedometerpp',
'sleep_cycle']
def get_service_module(service_name):
"""Import given service from dayonetools.services package"""
import importlib
... | 33.85 | 109 | 0.646677 |
import os
AVAILABLE_SERVICES = ['habit_list', 'idonethis', 'nikeplus', 'pedometerpp',
'sleep_cycle']
def get_service_module(service_name):
import importlib
services_pkg = 'dayonetools.services'
module = '%s.%s' % (services_pkg, service_name)
return importlib.import_module(m... | true | true |
f748fe828bfd8c507cc25481782051de2b923c94 | 103,242 | py | Python | python/tvm/relay/frontend/tensorflow.py | alexwong/tvm | 0b0bc3ed92b5578c481662287a39556f9b1a2535 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | null | null | null | python/tvm/relay/frontend/tensorflow.py | alexwong/tvm | 0b0bc3ed92b5578c481662287a39556f9b1a2535 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | null | null | null | python/tvm/relay/frontend/tensorflow.py | alexwong/tvm | 0b0bc3ed92b5578c481662287a39556f9b1a2535 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | null | null | null |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not ... | 40.062864 | 108 | 0.547674 |
from __future__ import absolute_import as _abs
from __future__ import print_function
import warnings
from collections import defaultdict
import numpy as np
import tvm
from tvm.relay.prelude import Prelude
from .. import analysis
from .. import expr as _expr
from .. import op as _op
from ..expr_f... | true | true |
f748ff3400cfbc96f543a55aac2f140e1e1f2e20 | 7,203 | py | Python | anchorecli/cli/repo.py | dspalmer99/anchore-cli | d62822326cb604b6a3ecb1ae6a701ef5a921a98b | [
"Apache-2.0"
] | null | null | null | anchorecli/cli/repo.py | dspalmer99/anchore-cli | d62822326cb604b6a3ecb1ae6a701ef5a921a98b | [
"Apache-2.0"
] | null | null | null | anchorecli/cli/repo.py | dspalmer99/anchore-cli | d62822326cb604b6a3ecb1ae6a701ef5a921a98b | [
"Apache-2.0"
] | null | null | null | import sys
import json
import click
import anchorecli.clients.apiexternal
import anchorecli.cli.utils
config = {}
@click.group(name="repo", short_help="Repository operations")
@click.pass_obj
def repo(ctx_config):
global config
config = ctx_config
try:
anchorecli.cli.utils.check_access(config)
... | 30.782051 | 99 | 0.605859 | import sys
import json
import click
import anchorecli.clients.apiexternal
import anchorecli.cli.utils
config = {}
@click.group(name="repo", short_help="Repository operations")
@click.pass_obj
def repo(ctx_config):
global config
config = ctx_config
try:
anchorecli.cli.utils.check_access(config)
... | true | true |
f748ffc94273f4060cf32adba44cc46cdd202830 | 402 | py | Python | tensorFlow/sklearn/a3.py | kopanya/good-sunday | dcd92edfa1866ca7b5806879ba6bd1f7c628da6e | [
"MIT"
] | 3 | 2018-06-05T02:51:42.000Z | 2018-06-05T02:51:52.000Z | tensorFlow/sklearn/a3.py | kopanya/good-sunday | dcd92edfa1866ca7b5806879ba6bd1f7c628da6e | [
"MIT"
] | null | null | null | tensorFlow/sklearn/a3.py | kopanya/good-sunday | dcd92edfa1866ca7b5806879ba6bd1f7c628da6e | [
"MIT"
] | null | null | null | from sklearn import datasets
from sklearn.linear_model import LinearRegression
import matplotlib.pyplot as plt
loaded_data = datasets.load_boston()
data_x = loaded_data.data
data_y = loaded_data.target
model = LinearRegression()
model.fit(data_x, data_y)
## print(model.predict(data_x[:4, :]))
print(model.coef_)
pr... | 22.333333 | 49 | 0.791045 | from sklearn import datasets
from sklearn.linear_model import LinearRegression
import matplotlib.pyplot as plt
loaded_data = datasets.load_boston()
data_x = loaded_data.data
data_y = loaded_data.target
model = LinearRegression()
model.fit(data_x, data_y)
rcept_)
print(model.get_params())
print(model.score(data_x, d... | true | true |
f74901ab5a36bbb330cacd91e5c4b63cea005791 | 1,805 | py | Python | braille_experience/braille_translator_kor/korean_decomposer.py | firekim2/braille_experience_django | 1c3ad48a6a16ef05e2703b8bef4fe58ca531ea90 | [
"MIT"
] | 2 | 2019-08-07T12:22:06.000Z | 2021-07-20T15:17:44.000Z | braille_experience/braille_translator_kor/korean_decomposer.py | firekim2/braille_experience_django | 1c3ad48a6a16ef05e2703b8bef4fe58ca531ea90 | [
"MIT"
] | null | null | null | braille_experience/braille_translator_kor/korean_decomposer.py | firekim2/braille_experience_django | 1c3ad48a6a16ef05e2703b8bef4fe58ca531ea90 | [
"MIT"
] | 1 | 2021-04-27T04:28:33.000Z | 2021-04-27T04:28:33.000Z | import re
"""
초성 중성 종성 분리 하기
유니코드 한글은 0xAC00 으로부터
초성 19개, 중상21개, 종성28개로 이루어지고
이들을 조합한 11,172개의 문자를 갖는다.
한글코드의 값 = ((초성 * 21) + 중성) * 28 + 종성 + 0xAC00
(0xAC00은 'ㄱ'의 코드값)
따라서 다음과 같은 계산 식이 구해진다.
유니코드 한글 문자 코드 값이 X일 때,
초성 = ((X - 0xAC00) / 28) / 21
중성 = ((X - 0xAC00) / 28) % 21
종성 = (X - 0xAC00) % 28
이 때 초성,... | 31.12069 | 77 | 0.471468 | import re
BASE_CODE, CHOSUNG, JUNGSUNG = 44032, 588, 28
CHOSUNG_LIST = ['ㄱ', 'ㄲ', 'ㄴ', 'ㄷ', 'ㄸ', 'ㄹ', 'ㅁ',
'ㅂ', 'ㅃ', 'ㅅ', 'ㅆ', 'ㅇ', 'ㅈ', 'ㅉ',
'ㅊ', 'ㅋ', 'ㅌ', 'ㅍ', 'ㅎ']
JUNGSUNG_LIST = ['ㅏ', 'ㅐ', 'ㅑ', 'ㅒ', 'ㅓ', 'ㅔ', 'ㅕ',
'ㅖ', 'ㅗ', 'ㅘ', 'ㅙ', 'ㅚ', 'ㅛ', 'ㅜ',
... | true | true |
f74901cbb7ef50e044e3ffa3aa9ab722b7bc541c | 829 | py | Python | manage.py | banctilrobitaille/RockETS-Basestation | 4c8e6f73ab4da5188c0014a5a23de2aa1dde8433 | [
"MIT"
] | 1 | 2018-06-11T14:31:45.000Z | 2018-06-11T14:31:45.000Z | manage.py | banctilrobitaille/RockETS-Basestation | 4c8e6f73ab4da5188c0014a5a23de2aa1dde8433 | [
"MIT"
] | 18 | 2017-02-21T15:11:15.000Z | 2021-06-10T18:20:48.000Z | manage.py | banctilrobitaille/RockETS-Basestation | 4c8e6f73ab4da5188c0014a5a23de2aa1dde8433 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "RockETS_Basestation.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensu... | 36.043478 | 83 | 0.638118 |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "RockETS_Basestation.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
try:
import django
except Imp... | true | true |
f74902a5ff605fe247d3a0a79fc3bacdfb2f46e0 | 4,747 | py | Python | saleor/graphql/payment/types.py | nlkhagva/saleor | 0d75807d08ac49afcc904733724ac870e8359c10 | [
"CC-BY-4.0"
] | null | null | null | saleor/graphql/payment/types.py | nlkhagva/saleor | 0d75807d08ac49afcc904733724ac870e8359c10 | [
"CC-BY-4.0"
] | null | null | null | saleor/graphql/payment/types.py | nlkhagva/saleor | 0d75807d08ac49afcc904733724ac870e8359c10 | [
"CC-BY-4.0"
] | null | null | null | import graphene
from graphene import relay
from ...payment import models
from ..core.connection import CountableDjangoObjectType
from ..core.types import Money
from .enums import OrderAction, PaymentChargeStatusEnum
class Transaction(CountableDjangoObjectType):
amount = graphene.Field(Money, description="Total a... | 30.429487 | 86 | 0.62945 | import graphene
from graphene import relay
from ...payment import models
from ..core.connection import CountableDjangoObjectType
from ..core.types import Money
from .enums import OrderAction, PaymentChargeStatusEnum
class Transaction(CountableDjangoObjectType):
amount = graphene.Field(Money, description="Total a... | true | true |
f74903deb54ec0299e4a33114894e96edc586686 | 30,669 | py | Python | pyNastran/op2/result_objects/stress_object.py | jtran10/pyNastran | 4aed8e05b91576c2b50ee835f0497a9aad1d2cb0 | [
"BSD-3-Clause"
] | null | null | null | pyNastran/op2/result_objects/stress_object.py | jtran10/pyNastran | 4aed8e05b91576c2b50ee835f0497a9aad1d2cb0 | [
"BSD-3-Clause"
] | null | null | null | pyNastran/op2/result_objects/stress_object.py | jtran10/pyNastran | 4aed8e05b91576c2b50ee835f0497a9aad1d2cb0 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function
import sys
from collections import OrderedDict
import numpy as np
#vm_word = get_plate_stress_strain(
#model, key, is_stress, vm_word, itime,
#oxx, oyy, txy, max_principal, min_principal, ovm, is_element_on,
#header_dict, keys_map)
class StressObject(object):
def ... | 39.268886 | 101 | 0.52121 | from __future__ import print_function
import sys
from collections import OrderedDict
import numpy as np
class StressObject(object):
def __init__(self, model, key, all_eids, is_stress=True):
self.model = model
self.vm_word = None
self.header_dict = OrderedDict()
... | true | true |
f7490452a943528c19f8273e031e8c7c57ae83f6 | 3,614 | py | Python | opyum/optimizations/__init__.py | Amper/opyum | daa2320eb4e70f6c535a589b71bb9db4868aedfc | [
"BSD-3-Clause"
] | 2 | 2016-01-24T16:48:02.000Z | 2016-02-02T04:31:02.000Z | opyum/optimizations/__init__.py | Amper/opyum | daa2320eb4e70f6c535a589b71bb9db4868aedfc | [
"BSD-3-Clause"
] | null | null | null | opyum/optimizations/__init__.py | Amper/opyum | daa2320eb4e70f6c535a589b71bb9db4868aedfc | [
"BSD-3-Clause"
] | null | null | null | """
"""
import sys
import os
import pkgutil
from ast import NodeTransformer
from abc import ABCMeta, abstractproperty
from inspect import isabstract
from importlib import import_module
from ..utils import classproperty
__all__ =\
[ "BasicOptimization"
, "ASTOptimization"
, "ByteCodeOptimi... | 24.924138 | 106 | 0.57637 |
import sys
import os
import pkgutil
from ast import NodeTransformer
from abc import ABCMeta, abstractproperty
from inspect import isabstract
from importlib import import_module
from ..utils import classproperty
__all__ =\
[ "BasicOptimization"
, "ASTOptimization"
, "ByteCodeOptimization"
... | true | true |
f74905a3332d7705e2afaa1438db227a3d5f80b8 | 35,875 | py | Python | tests/integration/test_listen_to_fedmsg.py | bcrocker15/packit-service | 184b4f3ef50c435d6045024190a867d34812cd9e | [
"MIT"
] | null | null | null | tests/integration/test_listen_to_fedmsg.py | bcrocker15/packit-service | 184b4f3ef50c435d6045024190a867d34812cd9e | [
"MIT"
] | null | null | null | tests/integration/test_listen_to_fedmsg.py | bcrocker15/packit-service | 184b4f3ef50c435d6045024190a867d34812cd9e | [
"MIT"
] | null | null | null | # Copyright Contributors to the Packit project.
# SPDX-License-Identifier: MIT
import json
import pytest
import requests
from celery.canvas import Signature
from flexmock import flexmock
from ogr.abstract import CommitStatus
from ogr.services.github import GithubProject
from ogr.utils import RequestResponse
from pack... | 36.019076 | 88 | 0.70269 |
import json
import pytest
import requests
from celery.canvas import Signature
from flexmock import flexmock
from ogr.abstract import CommitStatus
from ogr.services.github import GithubProject
from ogr.utils import RequestResponse
from packit.config import JobConfig, JobType, JobConfigTriggerType
from packit.config.... | true | true |
f749062197438f7922dd8e8b7ee219525df3da3d | 993 | py | Python | glance/db/sqlalchemy/migrate_repo/versions/044_update_metadef_os_nova_server.py | daespinel/glance | c8a00ea1f45679ce937146f9d7dadbbb056f1a48 | [
"Apache-2.0"
] | null | null | null | glance/db/sqlalchemy/migrate_repo/versions/044_update_metadef_os_nova_server.py | daespinel/glance | c8a00ea1f45679ce937146f9d7dadbbb056f1a48 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | glance/db/sqlalchemy/migrate_repo/versions/044_update_metadef_os_nova_server.py | daespinel/glance | c8a00ea1f45679ce937146f9d7dadbbb056f1a48 | [
"Apache-2.0"
] | 6 | 2018-09-06T14:50:23.000Z | 2018-11-27T21:32:51.000Z | # Copyright (c) 2016 Hewlett Packard Enterprise Software, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 36.777778 | 79 | 0.723061 |
from sqlalchemy import MetaData, Table
def upgrade(migrate_engine):
meta = MetaData()
meta.bind = migrate_engine
resource_types_table = Table('metadef_resource_types', meta, autoload=True)
resource_types_table.update(values={'name': 'OS::Nova::Server'}).where(
resource_types_t... | true | true |
f74906671f7a8dd5f9797cf79dcba680dbcd907a | 1,874 | py | Python | transperth/silver_rails/reference_data.py | Mause/pytransperth | 411c6a38b8451dc917927bdc4fdb70aeb9acd52b | [
"MIT"
] | null | null | null | transperth/silver_rails/reference_data.py | Mause/pytransperth | 411c6a38b8451dc917927bdc4fdb70aeb9acd52b | [
"MIT"
] | null | null | null | transperth/silver_rails/reference_data.py | Mause/pytransperth | 411c6a38b8451dc917927bdc4fdb70aeb9acd52b | [
"MIT"
] | null | null | null | import gzip
import json
from hashlib import md5
from concurrent import futures
from operator import itemgetter
import requests
from .utils import prepare_url
from . import BASE
class InvalidReferenceData(Exception):
pass
def _load_single_file(url):
r = requests.get(url['url'])
data = gzip.decompress(r... | 21.05618 | 69 | 0.627535 | import gzip
import json
from hashlib import md5
from concurrent import futures
from operator import itemgetter
import requests
from .utils import prepare_url
from . import BASE
class InvalidReferenceData(Exception):
pass
def _load_single_file(url):
r = requests.get(url['url'])
data = gzip.decompress(r... | true | true |
f74906a6430e3e2efcc9d0d78890a0704a70d3f5 | 13,854 | py | Python | modules/optimum/tests/openvino/test_modeling_ov_auto.py | xlla/openvino_contrib | bc2bd3007375883580fe2923478b8bf849a357b6 | [
"Apache-2.0"
] | null | null | null | modules/optimum/tests/openvino/test_modeling_ov_auto.py | xlla/openvino_contrib | bc2bd3007375883580fe2923478b8bf849a357b6 | [
"Apache-2.0"
] | null | null | null | modules/optimum/tests/openvino/test_modeling_ov_auto.py | xlla/openvino_contrib | bc2bd3007375883580fe2923478b8bf849a357b6 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import unittest
from packaging import version
import numpy as np
import transformers
from transformers import AutoTokenizer
import datasets
from datasets import DatasetDict, load_dataset
try:
from transformers.testing_ut... | 37.142091 | 119 | 0.617511 |
import os
import unittest
from packaging import version
import numpy as np
import transformers
from transformers import AutoTokenizer
import datasets
from datasets import DatasetDict, load_dataset
try:
from transformers.testing_utils import require_tf, require_torch
except ImportError:
from transformers.f... | true | true |
f74907b936eb00941f148a9f06560e3d56a0302c | 715 | py | Python | products/models.py | benoitboyer/DjangoBio | 415e048e7207f4abc6ac9b6bde7b7c7043aab78a | [
"MIT"
] | null | null | null | products/models.py | benoitboyer/DjangoBio | 415e048e7207f4abc6ac9b6bde7b7c7043aab78a | [
"MIT"
] | null | null | null | products/models.py | benoitboyer/DjangoBio | 415e048e7207f4abc6ac9b6bde7b7c7043aab78a | [
"MIT"
] | null | null | null | from django.db import models
# Create your models here.
class Product(models.Model):
product_brand = models.CharField(max_length=50)
product_article_code = models.CharField(max_length=20)
product_code= models.IntegerField()
product_name= models.CharField(max_length=150)
product_unit_packaging_number = models.Inte... | 29.791667 | 67 | 0.80979 | from django.db import models
class Product(models.Model):
product_brand = models.CharField(max_length=50)
product_article_code = models.CharField(max_length=20)
product_code= models.IntegerField()
product_name= models.CharField(max_length=150)
product_unit_packaging_number = models.IntegerField(default=1)
produ... | true | true |
f74907d392d5d895a9c32b3266d452eea41dc867 | 7,125 | py | Python | homeassistant/components/cloud/google_config.py | uniosmarthome/core | dd56b1c17606fff40968940a27db6f64bb71abec | [
"Apache-2.0"
] | 1 | 2021-03-17T10:07:33.000Z | 2021-03-17T10:07:33.000Z | homeassistant/components/cloud/google_config.py | uniosmarthome/core | dd56b1c17606fff40968940a27db6f64bb71abec | [
"Apache-2.0"
] | null | null | null | homeassistant/components/cloud/google_config.py | uniosmarthome/core | dd56b1c17606fff40968940a27db6f64bb71abec | [
"Apache-2.0"
] | null | null | null | """Google config for Cloud."""
import asyncio
import logging
from hass_uniocloud import cloud_api
from hass_uniocloud.google_report_state import ErrorResponse
from homeassistant.components.google_assistant.helpers import AbstractConfig
from homeassistant.const import (
CLOUD_NEVER_EXPOSED_ENTITIES,
EVENT_HOME... | 34.090909 | 87 | 0.674667 | import asyncio
import logging
from hass_uniocloud import cloud_api
from hass_uniocloud.google_report_state import ErrorResponse
from homeassistant.components.google_assistant.helpers import AbstractConfig
from homeassistant.const import (
CLOUD_NEVER_EXPOSED_ENTITIES,
EVENT_HOMEASSISTANT_STARTED,
HTTP_OK,... | true | true |
f749082fa67f8030d48365f1efb20d8eaa5afe3f | 794 | py | Python | setup.py | cvlabmiet/docx-replace | 30db49740b1ce3745182c459435bf472162e51ce | [
"MIT"
] | 2 | 2019-07-15T00:59:01.000Z | 2021-03-01T13:27:29.000Z | setup.py | cvlabmiet/docx-replace | 30db49740b1ce3745182c459435bf472162e51ce | [
"MIT"
] | null | null | null | setup.py | cvlabmiet/docx-replace | 30db49740b1ce3745182c459435bf472162e51ce | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from setuptools import setup
import re
script_content = open('docx-replace').read()
metadata = dict(re.findall("__([a-z]+)__\s*=\s*'([^']+)'", script_content))
setup(
name="docx-replace",
version=metadata['version'],
description="Replace text inside docx file",
url="https://gith... | 28.357143 | 75 | 0.615869 |
from setuptools import setup
import re
script_content = open('docx-replace').read()
metadata = dict(re.findall("__([a-z]+)__\s*=\s*'([^']+)'", script_content))
setup(
name="docx-replace",
version=metadata['version'],
description="Replace text inside docx file",
url="https://github.com/cvlabmiet/docx... | true | true |
f74909fb60ada34fad6592054a84512c7fa87b40 | 185 | py | Python | app/api/admin/__init__.py | WycliffeMuchumi/Stream-101-API | 9892685c37ff6f3e1e9017bfa5321968a5255c9e | [
"MIT"
] | null | null | null | app/api/admin/__init__.py | WycliffeMuchumi/Stream-101-API | 9892685c37ff6f3e1e9017bfa5321968a5255c9e | [
"MIT"
] | 1 | 2021-06-04T09:45:05.000Z | 2021-06-04T09:45:05.000Z | app/api/admin/__init__.py | muchumi/Stream-101-API | 9892685c37ff6f3e1e9017bfa5321968a5255c9e | [
"MIT"
] | 1 | 2021-06-04T09:43:58.000Z | 2021-06-04T09:43:58.000Z | from flask import Blueprint
"""
Admin Blueprint
"""
blueprint = Blueprint(
'admin_blueprint',
__name__,
url_prefix = '/admin'
)
from app.api.admin.views import admin | 13.214286 | 37 | 0.675676 | from flask import Blueprint
blueprint = Blueprint(
'admin_blueprint',
__name__,
url_prefix = '/admin'
)
from app.api.admin.views import admin | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.