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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7268d97ecd869e307e958def5462cfcc567d433 | 13,947 | py | Python | discum/guild/guild.py | DJJ05/Discord-S.C.U.M | 498c2aebb71cef331b1c47a8bb6ffe65e88d2a34 | [
"MIT"
] | 1 | 2022-01-02T13:39:38.000Z | 2022-01-02T13:39:38.000Z | discum/guild/guild.py | DJJ05/Discord-S.C.U.M | 498c2aebb71cef331b1c47a8bb6ffe65e88d2a34 | [
"MIT"
] | null | null | null | discum/guild/guild.py | DJJ05/Discord-S.C.U.M | 498c2aebb71cef331b1c47a8bb6ffe65e88d2a34 | [
"MIT"
] | 2 | 2022-02-17T13:04:55.000Z | 2022-02-28T00:48:00.000Z | from ..RESTapiwrap import Wrapper
from ..utils.permissions import PERMS, Permissions
from ..utils.contextproperties import ContextProperties
import time
import base64
try:
from urllib.parse import quote
except ImportError:
from urllib import quote
class Guild(object):
__slots__ = ['discord', 's', 'log']
def __in... | 44.990323 | 226 | 0.723095 | from ..RESTapiwrap import Wrapper
from ..utils.permissions import PERMS, Permissions
from ..utils.contextproperties import ContextProperties
import time
import base64
try:
from urllib.parse import quote
except ImportError:
from urllib import quote
class Guild(object):
__slots__ = ['discord', 's', 'log']
def __in... | true | true |
f7268dac2e06e129091c886ee83609a1a78deda9 | 2,558 | py | Python | sharpy/combat/terran/micro_liberators.py | DuncanDHall/sharpy-sc2 | 7a47a7538ad99214e3f0288b6213cac882551180 | [
"MIT"
] | null | null | null | sharpy/combat/terran/micro_liberators.py | DuncanDHall/sharpy-sc2 | 7a47a7538ad99214e3f0288b6213cac882551180 | [
"MIT"
] | null | null | null | sharpy/combat/terran/micro_liberators.py | DuncanDHall/sharpy-sc2 | 7a47a7538ad99214e3f0288b6213cac882551180 | [
"MIT"
] | null | null | null | from typing import Dict, Optional
from sc2.ids.ability_id import AbilityId
from sharpy.combat import Action, MoveType, MicroStep
from sc2.ids.unit_typeid import UnitTypeId
from sc2.unit import Unit
from sc2.position import Point2
class MicroLiberators(MicroStep):
def __init__(self, group_distance: float = -5):
... | 38.757576 | 111 | 0.635262 | from typing import Dict, Optional
from sc2.ids.ability_id import AbilityId
from sharpy.combat import Action, MoveType, MicroStep
from sc2.ids.unit_typeid import UnitTypeId
from sc2.unit import Unit
from sc2.position import Point2
class MicroLiberators(MicroStep):
def __init__(self, group_distance: float = -5):
... | true | true |
f7268dd4e5fbd94440e9ab3dc5fe73f4c538070d | 6,616 | py | Python | bindings/python/ensmallen_graph/datasets/string/proteusmirabilis.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/proteusmirabilis.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/proteusmirabilis.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | """
This file offers the methods to automatically retrieve the graph Proteus mirabilis.
The graph is automatically retrieved from the STRING repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: 2021-02-0... | 35.005291 | 223 | 0.700574 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen_graph import EnsmallenGraph
def ProteusMirabilis(
directed: bool = False,
verbose: int = 2,
cache_path: str = "graphs/string",
**additional_graph_kwargs: Dict
) -> EnsmallenGraph:
retur... | true | true |
f7268f4b4bb9d783f2b2aaad61a415d7093b910f | 65 | py | Python | tools/__init__.py | mchonan1996/safetyculture-sdk-python | 9737b8716698844dc09316baed0d50fc55c6ea8b | [
"Apache-2.0"
] | 22 | 2017-03-03T05:16:46.000Z | 2021-12-28T20:39:02.000Z | tools/__init__.py | mchonan1996/safetyculture-sdk-python | 9737b8716698844dc09316baed0d50fc55c6ea8b | [
"Apache-2.0"
] | 12 | 2017-02-28T06:29:07.000Z | 2021-03-25T21:42:14.000Z | tools/__init__.py | mchonan1996/safetyculture-sdk-python | 9737b8716698844dc09316baed0d50fc55c6ea8b | [
"Apache-2.0"
] | 15 | 2017-02-23T00:49:18.000Z | 2021-12-28T20:39:20.000Z | from .exporter import csvExporter
from .exporter import exporter
| 21.666667 | 33 | 0.846154 | from .exporter import csvExporter
from .exporter import exporter
| true | true |
f7268fd09962820734816832c033e7525fcd9ab8 | 432 | py | Python | website/util/time.py | DanielSBrown/osf.io | 98dda2ac237377197acacce78274bc0a4ce8f303 | [
"Apache-2.0"
] | null | null | null | website/util/time.py | DanielSBrown/osf.io | 98dda2ac237377197acacce78274bc0a4ce8f303 | [
"Apache-2.0"
] | null | null | null | website/util/time.py | DanielSBrown/osf.io | 98dda2ac237377197acacce78274bc0a4ce8f303 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import time
from datetime import datetime
def get_timestamp():
return int(time.time())
def throttle_period_expired(timestamp, throttle):
if not timestamp:
return True
elif isinstance(timestamp, datetime):
return (datetime.utc... | 24 | 73 | 0.699074 |
from __future__ import absolute_import
import time
from datetime import datetime
def get_timestamp():
return int(time.time())
def throttle_period_expired(timestamp, throttle):
if not timestamp:
return True
elif isinstance(timestamp, datetime):
return (datetime.utcnow() - timestamp).tota... | true | true |
f726902376e280ba863a7c19c43b900218daf48a | 4,130 | py | Python | alipay/aop/api/request/AlipayMarketingCampaignPromotionactivityCustomerReceiveRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/request/AlipayMarketingCampaignPromotionactivityCustomerReceiveRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/request/AlipayMarketingCampaignPromotionactivityCustomerReceiveRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayMarketingCampaignPromotionactivityCustomerReceiveModel import AlipayMarketingCampaignPromotionactivityCustomerReceiveModel
cla... | 28.482759 | 155 | 0.658111 |
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayMarketingCampaignPromotionactivityCustomerReceiveModel import AlipayMarketingCampaignPromotionactivityCustomerReceiveModel
class AlipayMarketingCampaignPromotionactivityC... | true | true |
f7269048fed394fc95bcb70e5e4e1c5ecb768bd1 | 2,752 | py | Python | py_pdf_term/analysis/_analysis/occurrences/term.py | kumachan-mis/pdf-slides-term | cf3319e4de723bd9424d23141803342d3c649103 | [
"MIT"
] | 1 | 2021-01-08T16:05:30.000Z | 2021-01-08T16:05:30.000Z | py_pdf_term/analysis/_analysis/occurrences/term.py | kumachan-mis/py-slides-term | 1e9337b97ae8968950489e728fc7aeeeb7eb1f4b | [
"MIT"
] | 21 | 2021-01-03T13:50:59.000Z | 2021-06-17T00:27:49.000Z | py_pdf_term/analysis/_analysis/occurrences/term.py | kumachan-mis/pdf-slides-term | cf3319e4de723bd9424d23141803342d3c649103 | [
"MIT"
] | null | null | null | from dataclasses import dataclass
from typing import Set, Dict
from ..runner import AnalysisRunner
from py_pdf_term.candidates import DomainCandidateTermList
from py_pdf_term._common.data import Term
@dataclass(frozen=True)
class DomainTermOccurrence:
domain: str
# unique domain name
term_freq: Dict[str,... | 37.189189 | 87 | 0.68968 | from dataclasses import dataclass
from typing import Set, Dict
from ..runner import AnalysisRunner
from py_pdf_term.candidates import DomainCandidateTermList
from py_pdf_term._common.data import Term
@dataclass(frozen=True)
class DomainTermOccurrence:
domain: str
term_freq: Dict[str, int]
... | true | true |
f72690a7b3248a10457383f38300fee9412153dd | 124,514 | py | Python | Compiler/types.py | lemonviv/Pivot-SPDZ | f3db87d8849e5f9fa39f321d85feec83107ee405 | [
"BSD-2-Clause"
] | null | null | null | Compiler/types.py | lemonviv/Pivot-SPDZ | f3db87d8849e5f9fa39f321d85feec83107ee405 | [
"BSD-2-Clause"
] | null | null | null | Compiler/types.py | lemonviv/Pivot-SPDZ | f3db87d8849e5f9fa39f321d85feec83107ee405 | [
"BSD-2-Clause"
] | null | null | null | from Compiler.program import Tape
from Compiler.exceptions import *
from Compiler.instructions import *
from Compiler.instructions_base import *
from .floatingpoint import two_power
from . import comparison, floatingpoint
import math
from . import util
import operator
from functools import reduce
class ClientMessageT... | 32.792731 | 202 | 0.561166 | from Compiler.program import Tape
from Compiler.exceptions import *
from Compiler.instructions import *
from Compiler.instructions_base import *
from .floatingpoint import two_power
from . import comparison, floatingpoint
import math
from . import util
import operator
from functools import reduce
class ClientMessageT... | true | true |
f72692b82fed413b8a80f995369aec1ebc838715 | 668 | py | Python | onlineassessmentsystem/blog/migrations/0001_initial.py | nevilparmar11/SDP_Online_Assessment_System | 012a1ec7dfca2973a5e03b0f970394cfa674b61e | [
"MIT"
] | 2 | 2021-05-22T15:44:19.000Z | 2021-05-22T17:59:58.000Z | onlineassessmentsystem/blog/migrations/0001_initial.py | jwalit21/SDP_Online_Assessment_System | a778a0e0ae264fe74037a5f0b210d205ebc18d98 | [
"MIT"
] | 7 | 2021-01-18T06:06:38.000Z | 2021-03-03T15:09:17.000Z | onlineassessmentsystem/blog/migrations/0001_initial.py | jwalit21/SDP_Online_Assessment_System | a778a0e0ae264fe74037a5f0b210d205ebc18d98 | [
"MIT"
] | 2 | 2021-03-05T12:28:28.000Z | 2021-05-24T16:10:07.000Z | # Generated by Django 3.1.5 on 2021-01-09 16:06
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Blog',
fields=[
('blogId', models.AutoField... | 27.833333 | 103 | 0.58982 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Blog',
fields=[
('blogId', models.AutoField(primary_key=True, serialize=False)),
... | true | true |
f72693b15cffa1a04a5fc7222fdd4715cbead461 | 716 | py | Python | tests/test_mag_orms.py | nestauk/ai_research | 19fd193b098dc68706b945e959fad29c4bfed781 | [
"MIT"
] | 3 | 2020-02-24T19:25:39.000Z | 2021-06-29T10:38:29.000Z | tests/test_mag_orms.py | nestauk/ai_research | 19fd193b098dc68706b945e959fad29c4bfed781 | [
"MIT"
] | 19 | 2020-02-24T07:48:52.000Z | 2020-12-21T10:50:14.000Z | tests/test_mag_orms.py | nestauk/ai_research | 19fd193b098dc68706b945e959fad29c4bfed781 | [
"MIT"
] | null | null | null | import pytest
import unittest
import os
from sqlalchemy.orm import sessionmaker
from sqlalchemy import create_engine
from ai_research.mag.mag_orm import Base
from dotenv import load_dotenv, find_dotenv
load_dotenv(find_dotenv())
class TestMag(unittest.TestCase):
"""Check that the MAG ORM works as expected"""
... | 22.375 | 56 | 0.710894 | import pytest
import unittest
import os
from sqlalchemy.orm import sessionmaker
from sqlalchemy import create_engine
from ai_research.mag.mag_orm import Base
from dotenv import load_dotenv, find_dotenv
load_dotenv(find_dotenv())
class TestMag(unittest.TestCase):
engine = create_engine(os.getenv("test_postgresdb... | true | true |
f72693b16d34b944f5bb4a1349f76575267e7ffa | 1,136 | py | Python | examples/hacker_news/hacker_news/resources/s3_notebook_io_manager.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | examples/hacker_news/hacker_news/resources/s3_notebook_io_manager.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | examples/hacker_news/hacker_news/resources/s3_notebook_io_manager.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | from dagstermill.io_managers import OutputNotebookIOManager
from dagster import io_manager
from .fixed_s3_pickle_io_manager import s3_client
class S3OutputNotebookIOManager(OutputNotebookIOManager):
"""Defines an IOManager that will store dagstermill output notebooks on s3"""
def _get_key(self, context) ->... | 37.866667 | 82 | 0.727113 | from dagstermill.io_managers import OutputNotebookIOManager
from dagster import io_manager
from .fixed_s3_pickle_io_manager import s3_client
class S3OutputNotebookIOManager(OutputNotebookIOManager):
def _get_key(self, context) -> str:
return "notebooks/" + "_".join(context.get_run_scoped_output_identif... | true | true |
f72695448dd7c1288748bbad417bedf5678eb8a3 | 3,495 | py | Python | src/wpusher/vdesk.py | brenttaylor/WindowPusher | d6ecb9aa1ad69e954cba5632ee56fd6f6c1f8c06 | [
"BSD-3-Clause"
] | null | null | null | src/wpusher/vdesk.py | brenttaylor/WindowPusher | d6ecb9aa1ad69e954cba5632ee56fd6f6c1f8c06 | [
"BSD-3-Clause"
] | null | null | null | src/wpusher/vdesk.py | brenttaylor/WindowPusher | d6ecb9aa1ad69e954cba5632ee56fd6f6c1f8c06 | [
"BSD-3-Clause"
] | null | null | null | import user32
import win32con
import ctypes
import collections
class VirtualDesktopException(Exception):
pass
class NoForegroundWindow(VirtualDesktopException):
pass
class VirtualDesktop(object):
def __init__(self):
self.window = []
self.removed_windows = []
def remove_foreground_... | 29.871795 | 99 | 0.654649 | import user32
import win32con
import ctypes
import collections
class VirtualDesktopException(Exception):
pass
class NoForegroundWindow(VirtualDesktopException):
pass
class VirtualDesktop(object):
def __init__(self):
self.window = []
self.removed_windows = []
def remove_foreground_... | true | true |
f7269554e70b05b444508f2c600f6f0487716659 | 2,187 | py | Python | src/jobhunt_prod/scrape/multiprocess_simply.py | smiller20/CareerCentral | 455df0910dff1a1883fd56365a7a4feeb7726b22 | [
"MIT"
] | null | null | null | src/jobhunt_prod/scrape/multiprocess_simply.py | smiller20/CareerCentral | 455df0910dff1a1883fd56365a7a4feeb7726b22 | [
"MIT"
] | null | null | null | src/jobhunt_prod/scrape/multiprocess_simply.py | smiller20/CareerCentral | 455df0910dff1a1883fd56365a7a4feeb7726b22 | [
"MIT"
] | 1 | 2020-12-04T22:57:24.000Z | 2020-12-04T22:57:24.000Z | """
simply hired using multi process design
scrape through 11 pages of simply using a multi processing for each I/O (4x faster)
"""
from requests import get
from bs4 import BeautifulSoup
from threading import Thread
import multiprocessing
from os import getpid
import psutil
def get_simply(url, role ):
alldata={}
... | 33.646154 | 120 | 0.621856 |
from requests import get
from bs4 import BeautifulSoup
from threading import Thread
import multiprocessing
from os import getpid
import psutil
def get_simply(url, role ):
alldata={}
response = get(url, headers={'User-Agent': 'Mozilla/5.0'})
try:
soup = BeautifulSoup(response.text, 'html.parser')
... | true | true |
f7269559f7d7eaf9efb701f4e1ac759e3c36654f | 502 | py | Python | aardvark/__about__.py | mbaciu-gpsw/aardvark | c2a0797bf3769ba819dcbacd4a80f4e9764d035e | [
"Apache-2.0"
] | null | null | null | aardvark/__about__.py | mbaciu-gpsw/aardvark | c2a0797bf3769ba819dcbacd4a80f4e9764d035e | [
"Apache-2.0"
] | 10 | 2019-07-23T09:03:02.000Z | 2019-10-15T14:53:14.000Z | aardvark/__about__.py | mbaciu-gpsw/aardvark | c2a0797bf3769ba819dcbacd4a80f4e9764d035e | [
"Apache-2.0"
] | 1 | 2022-01-11T13:06:32.000Z | 2022-01-11T13:06:32.000Z | __all__ = [
"__title__", "__summary__", "__uri__", "__version__", "__author__",
"__email__", "__license__", "__copyright__",
]
__title__ = "aardvark"
__summary__ = ("Multi-Account AWS IAM Access Advisor API")
__uri__ = "https://github.com/Netflix-Skunkworks/aardvark"
__version__ = "0.2.1"
__author__ = "Patri... | 29.529412 | 71 | 0.7251 | __all__ = [
"__title__", "__summary__", "__uri__", "__version__", "__author__",
"__email__", "__license__", "__copyright__",
]
__title__ = "aardvark"
__summary__ = ("Multi-Account AWS IAM Access Advisor API")
__uri__ = "https://github.com/Netflix-Skunkworks/aardvark"
__version__ = "0.2.1"
__author__ = "Patri... | true | true |
f726956703146c7de18a5d8a95ca243d34616547 | 12,727 | py | Python | pydmd/hankeldmd.py | kathryn-garside/PyDMD-fork | 0158c4144019f0899ce34ec44286b0f700c56b38 | [
"MIT"
] | null | null | null | pydmd/hankeldmd.py | kathryn-garside/PyDMD-fork | 0158c4144019f0899ce34ec44286b0f700c56b38 | [
"MIT"
] | null | null | null | pydmd/hankeldmd.py | kathryn-garside/PyDMD-fork | 0158c4144019f0899ce34ec44286b0f700c56b38 | [
"MIT"
] | null | null | null | """
Derived module from dmdbase.py for hankel dmd.
Reference:
- H. Arbabi, I. Mezic, Ergodic theory, dynamic mode decomposition, and
computation of spectral properties of the Koopman operator. SIAM Journal on
Applied Dynamical Systems, 2017, 16.4: 2096-2126.
"""
from copy import copy
import numpy as np
from .dmdbase... | 36.997093 | 79 | 0.613735 | from copy import copy
import numpy as np
from .dmdbase import DMDBase
from .dmd import DMD
class HankelDMD(DMDBase):
def __init__(
self,
svd_rank=0,
tlsq_rank=0,
exact=False,
opt=False,
rescale_mode=None,
forward_backward=False,
d=1,
sorte... | true | true |
f72695c880ab96368ab83d470e012d516b14bf5a | 1,438 | py | Python | pfrl/policies/softmax_policy.py | tkelestemur/pfrl | 388855fb30313185d43ae0d0f4b694be647a5c43 | [
"MIT"
] | null | null | null | pfrl/policies/softmax_policy.py | tkelestemur/pfrl | 388855fb30313185d43ae0d0f4b694be647a5c43 | [
"MIT"
] | 1 | 2021-05-14T20:53:26.000Z | 2021-05-20T15:58:32.000Z | pfrl/policies/softmax_policy.py | tkelestemur/pfrl | 388855fb30313185d43ae0d0f4b694be647a5c43 | [
"MIT"
] | 1 | 2021-06-09T03:17:34.000Z | 2021-06-09T03:17:34.000Z | import torch
from torch import nn
from torch.distributions import Categorical
class SoftmaxCategoricalHead(nn.Module):
def forward(self, logits):
return torch.distributions.Categorical(logits=logits)
# class MultiSoftmaxCategoricalHead(nn.Module):
# def forward(self, logits):
# return Indepe... | 29.958333 | 85 | 0.665508 | import torch
from torch import nn
from torch.distributions import Categorical
class SoftmaxCategoricalHead(nn.Module):
def forward(self, logits):
return torch.distributions.Categorical(logits=logits)
class MultiCategorical():
def __init__(self, dims=None, logits=None):
self.dims = dims
... | true | true |
f72695ed24f4c5a0ae1409ac5bdd45ac4dd38389 | 27,191 | py | Python | .qt_for_python/rcc/application.py | RodrooMtz/app_escritorio | e918f086d2b3a0a9749c8afb20e11845773cd117 | [
"MIT"
] | null | null | null | .qt_for_python/rcc/application.py | RodrooMtz/app_escritorio | e918f086d2b3a0a9749c8afb20e11845773cd117 | [
"MIT"
] | null | null | null | .qt_for_python/rcc/application.py | RodrooMtz/app_escritorio | e918f086d2b3a0a9749c8afb20e11845773cd117 | [
"MIT"
] | null | null | null | # Resource object code (Python 3)
# Created by: object code
# Created by: The Resource Compiler for Qt version 6.0.4
# WARNING! All changes made in this file will be lost!
from PySide6 import QtCore
qt_resource_data = b"\
\x00\x00\x08\x19\
\x89\
PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\
\x00\x00 \x00\x00\x00 \x08\... | 44.648604 | 96 | 0.710603 |
from PySide6 import QtCore
qt_resource_data = b"\
\x00\x00\x08\x19\
\x89\
PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\
\x00\x00 \x00\x00\x00 \x08\x06\x00\x00\x00szz\xf4\
\x00\x00\x00\x04gAMA\x00\x00\xd6\xd8\xd4OX2\
\x00\x00\x00\x19tEXtSoftware\
\x00Adobe ImageRead\
yq\xc9e<\x00\x00\x07\xabIDATX\xc3\xad\
W[P\x93g\... | true | true |
f72696fc0cf591521dd786bc37d9a5424a0b4f8b | 298 | py | Python | tests/test_singleton_container.py | ClanPlay/Python_IoC | fad7a3053a7a2193474caa5918508307cfd7b79a | [
"MIT"
] | 4 | 2019-02-20T19:44:32.000Z | 2019-02-22T13:32:25.000Z | tests/test_singleton_container.py | ClanPlay-Market/clanplay_Python_IoC | fad7a3053a7a2193474caa5918508307cfd7b79a | [
"MIT"
] | 1 | 2019-02-20T14:48:04.000Z | 2019-02-20T14:48:23.000Z | tests/test_singleton_container.py | ClanPlay/Python_IoC | fad7a3053a7a2193474caa5918508307cfd7b79a | [
"MIT"
] | null | null | null | from flying_ioc import IocManager
class TSingleton1:
def __init__(self):
pass
def test_singleton_container():
ioc = IocManager(stats=True)
ioc.set_class(name='singleton1', cls=TSingleton1, singleton=True)
assert ioc.singleton1 is ioc.singleton1
ioc.print_stats()
| 17.529412 | 69 | 0.721477 | from flying_ioc import IocManager
class TSingleton1:
def __init__(self):
pass
def test_singleton_container():
ioc = IocManager(stats=True)
ioc.set_class(name='singleton1', cls=TSingleton1, singleton=True)
assert ioc.singleton1 is ioc.singleton1
ioc.print_stats()
| true | true |
f72698682f1d9db8336712cdc43ed2619483c604 | 1,583 | py | Python | 61dust.py | krikor-s/homework | 63c6711fe0ea64f5d3087673ac931dd0503be546 | [
"MIT"
] | null | null | null | 61dust.py | krikor-s/homework | 63c6711fe0ea64f5d3087673ac931dd0503be546 | [
"MIT"
] | null | null | null | 61dust.py | krikor-s/homework | 63c6711fe0ea64f5d3087673ac931dd0503be546 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# 61dust.py
import argparse
from fileinput import filename
import mcb185 as mcb
# Write a program that finds and masks low entropy sequence
# Use argparse for the following parameters
# sequence file
# window size
# entropy threshold
# lowercase or N-based masking
# The program should o... | 28.267857 | 87 | 0.713834 |
import argparse
from fileinput import filename
import mcb185 as mcb
parser = argparse.ArgumentParser(description='Outputs of masked low entropy sequence.')
parser.add_argument('--fasta', required=True, type=str,
metavar='<str>', help='required FASTA file')
parser.add_argument('--wins', required=True, t... | true | true |
f726986d83879eef6d553b88636ef538361fe2f9 | 14,545 | py | Python | qa/rpc-tests/dip4-coinbasemerkleroots.py | Wildfire-new/Wildfire-MN-POW | 0434339c79fa8525408b8edd1ff003be4f367e1c | [
"MIT"
] | 1 | 2021-01-22T17:22:27.000Z | 2021-01-22T17:22:27.000Z | qa/rpc-tests/dip4-coinbasemerkleroots.py | Wildfire-new/Wildfire-MN-POW | 0434339c79fa8525408b8edd1ff003be4f367e1c | [
"MIT"
] | 4 | 2020-12-01T01:38:47.000Z | 2021-01-21T19:19:57.000Z | qa/rpc-tests/dip4-coinbasemerkleroots.py | Wildfire-new/Wildfire-MN-POW | 0434339c79fa8525408b8edd1ff003be4f367e1c | [
"MIT"
] | 1 | 2021-08-25T06:44:01.000Z | 2021-08-25T06:44:01.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2018 The Dash Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from collections import namedtuple
from test_framework.mininode import *
from test_framework.test_framework ... | 48.645485 | 169 | 0.691097 |
from collections import namedtuple
from test_framework.mininode import *
from test_framework.test_framework import WildfireTestFramework
from test_framework.util import *
from time import *
class TestNode(SingleNodeConnCB):
def __init__(self):
SingleNodeConnCB.__init__(self)
self.last_mnlistd... | true | true |
f72698df2982562089d403ee92680cbf783ca0e2 | 31,875 | py | Python | examples/pxScene2d/external/libnode-v6.9.0/tools/comtypes/typeinfo.py | madanagopaltcomcast/pxCore | c4a3a40a190521c8b6383d126c87612eca5b3c42 | [
"Apache-2.0"
] | 46 | 2017-09-07T14:59:22.000Z | 2020-10-31T20:34:12.000Z | examples/pxScene2d/external/libnode-v6.9.0/tools/comtypes/typeinfo.py | madanagopaltcomcast/pxCore | c4a3a40a190521c8b6383d126c87612eca5b3c42 | [
"Apache-2.0"
] | 1,432 | 2017-06-21T04:08:48.000Z | 2020-08-25T16:21:15.000Z | examples/pxScene2d/external/libnode-v6.9.0/tools/comtypes/typeinfo.py | madanagopaltcomcast/pxCore | c4a3a40a190521c8b6383d126c87612eca5b3c42 | [
"Apache-2.0"
] | 317 | 2017-06-20T19:57:17.000Z | 2020-09-16T10:28:30.000Z | # XXX Should convert from STDMETHOD to COMMETHOD.
# generated by 'xml2py'
# flags '..\tools\windows.xml -m comtypes -m comtypes.automation -w -r .*TypeLibEx -r .*TypeLib -o typeinfo.py'
# then hacked manually
import os
import sys
import weakref
from ctypes import *
from ctypes.wintypes import ULONG
from comtypes impo... | 34.874179 | 134 | 0.637427 |
import os
import sys
import weakref
from ctypes import *
from ctypes.wintypes import ULONG
from comtypes import STDMETHOD
from comtypes import COMMETHOD
from comtypes import _GUID, GUID
from comtypes.automation import BSTR
from comtypes.automation import DISPID
from comtypes.automation import DISPPARAMS
from com... | true | true |
f72698ecbc016f7724c2386a1d6649e19cd6da72 | 5,206 | py | Python | manimlib/animation/growing.py | SidewayOutput/Basic-Manim | 4dea4b00daa7b6f66ed7b26659045f67609d83b6 | [
"MIT"
] | null | null | null | manimlib/animation/growing.py | SidewayOutput/Basic-Manim | 4dea4b00daa7b6f66ed7b26659045f67609d83b6 | [
"MIT"
] | null | null | null | manimlib/animation/growing.py | SidewayOutput/Basic-Manim | 4dea4b00daa7b6f66ed7b26659045f67609d83b6 | [
"MIT"
] | null | null | null | from manimlib.animation.transform import Transform
from manimlib.basic.basic_function import to_expand_lists, to_get_point
from manimlib.constants import PI
from manimlib.utils.config_ops import generate_args, merge_config_kwargs
class GrowFromPoint(Transform):
def __init__(self, mobject, mobject_or_point="get_ce... | 32.135802 | 84 | 0.664426 | from manimlib.animation.transform import Transform
from manimlib.basic.basic_function import to_expand_lists, to_get_point
from manimlib.constants import PI
from manimlib.utils.config_ops import generate_args, merge_config_kwargs
class GrowFromPoint(Transform):
def __init__(self, mobject, mobject_or_point="get_ce... | true | true |
f726991caedc24166bb6ed9a085571aa0555465e | 4,333 | py | Python | sdks/python/appcenter_sdk/models/InternalHockeyAppCutoverStatusResponse.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | null | null | null | sdks/python/appcenter_sdk/models/InternalHockeyAppCutoverStatusResponse.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 6 | 2019-10-23T06:38:53.000Z | 2022-01-22T07:57:58.000Z | sdks/python/appcenter_sdk/models/InternalHockeyAppCutoverStatusResponse.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 2 | 2019-10-23T06:31:05.000Z | 2021-08-21T17:32:47.000Z | # coding: utf-8
"""
App Center Client
Microsoft Visual Studio App Center API # noqa: E501
OpenAPI spec version: preview
Contact: benedetto.abbenanti@gmail.com
Project Repository: https://github.com/b3nab/appcenter-sdks
"""
import pprint
import re # noqa: F401
import six
class InternalHockey... | 29.080537 | 95 | 0.587122 |
import pprint
import re
import six
class InternalHockeyAppCutoverStatusResponse(object):
not_requested = "not_requested"
requested = "requested"
in_progress = "in_progress"
completed = "completed"
swagger_types = {
'id': 'string',
'status': 'string'
}
attribute_map ... | true | true |
f7269945af61fa78d01b7ddd1fc00faa4eb56f7f | 8,120 | py | Python | utils/swift_build_support/swift_build_support/targets.py | DougGregor/swift | 16b686989c12bb1acf9d1a490c1f301d71428f47 | [
"Apache-2.0"
] | 11 | 2016-01-26T22:56:55.000Z | 2022-03-28T05:57:56.000Z | utils/swift_build_support/swift_build_support/targets.py | danielgalasko/swift | e2501ad9f9e53a7156148d6da5c7796e487723f8 | [
"Apache-2.0"
] | 2 | 2019-04-11T21:36:21.000Z | 2021-04-14T06:09:10.000Z | utils/swift_build_support/swift_build_support/targets.py | DougGregor/swift | 16b686989c12bb1acf9d1a490c1f301d71428f47 | [
"Apache-2.0"
] | 1 | 2016-08-24T17:30:38.000Z | 2016-08-24T17:30:38.000Z | # swift_build_support/targets.py - Build target helpers -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://swift.org/LICENSE.txt for lic... | 34.261603 | 79 | 0.607759 |
import os
import platform
class Platform(object):
def __init__(self, name, archs, sdk_name=None):
self.name = name
self.targets = [Target(self, arch) for arch in archs]
self.sdk_name = name.upper() if sdk_name is None else sdk_name
fo... | true | true |
f7269969627b886f2d9ff179c1f78a4abf30f3d0 | 1,426 | py | Python | Python/DataStructures/Trie.py | AndrewMcShane/DevMakingSource | fe58fa093e0ce2d2748cb3826d27be6b0ac34149 | [
"MIT"
] | 3 | 2021-03-22T14:13:56.000Z | 2022-03-01T03:06:22.000Z | Python/DataStructures/Trie.py | AndrewMcShane/DevMakingSource | fe58fa093e0ce2d2748cb3826d27be6b0ac34149 | [
"MIT"
] | null | null | null | Python/DataStructures/Trie.py | AndrewMcShane/DevMakingSource | fe58fa093e0ce2d2748cb3826d27be6b0ac34149 | [
"MIT"
] | null | null | null | class TrieNode:
def __init__(self):
self.children = {}
self.isWord = False
class Trie:
def __init__(self):
self.root = TrieNode()
def put(self, word):
current = self.root
for i in range(0, len(word)):
child = word[i]
tmp = None
... | 26.90566 | 80 | 0.497896 | class TrieNode:
def __init__(self):
self.children = {}
self.isWord = False
class Trie:
def __init__(self):
self.root = TrieNode()
def put(self, word):
current = self.root
for i in range(0, len(word)):
child = word[i]
tmp = None
... | true | true |
f72699b30c150ef217cd9689772840359f84dd62 | 8,999 | py | Python | sunpy/coordinates/wcs_utils.py | LaudateCorpus1/sunpy | f7bdf22e5229a577c5851c1e05502f0d68b4b369 | [
"BSD-2-Clause"
] | 628 | 2015-01-14T17:34:10.000Z | 2022-03-29T06:07:50.000Z | sunpy/coordinates/wcs_utils.py | wtbarnes/sunpy | f7bdf22e5229a577c5851c1e05502f0d68b4b369 | [
"BSD-2-Clause"
] | 3,983 | 2015-01-03T11:16:21.000Z | 2022-03-31T16:55:38.000Z | sunpy/coordinates/wcs_utils.py | wtbarnes/sunpy | f7bdf22e5229a577c5851c1e05502f0d68b4b369 | [
"BSD-2-Clause"
] | 582 | 2015-01-14T10:09:24.000Z | 2022-03-29T06:07:12.000Z | import numpy as np
import astropy.units as u
import astropy.wcs.utils
from astropy.coordinates import (
ITRS,
BaseCoordinateFrame,
CartesianRepresentation,
SkyCoord,
SphericalRepresentation,
)
from astropy.wcs import WCS
from sunpy import log
from .frames import (
BaseCoordinateFrame,
Heli... | 33.830827 | 88 | 0.628737 | import numpy as np
import astropy.units as u
import astropy.wcs.utils
from astropy.coordinates import (
ITRS,
BaseCoordinateFrame,
CartesianRepresentation,
SkyCoord,
SphericalRepresentation,
)
from astropy.wcs import WCS
from sunpy import log
from .frames import (
BaseCoordinateFrame,
Heli... | true | true |
f7269bbfbe9e6440da662f049b38c023e316d1dd | 17,900 | py | Python | backend/main.py | Plane-walker/fabric-draw | 7a3b4baef4d59a47c046e68d1fc5f20aeddd4c11 | [
"MIT"
] | 1 | 2021-09-01T06:31:26.000Z | 2021-09-01T06:31:26.000Z | backend/main.py | Plane-walker/fabric-draw | 7a3b4baef4d59a47c046e68d1fc5f20aeddd4c11 | [
"MIT"
] | 20 | 2021-09-22T13:04:07.000Z | 2021-10-11T12:27:12.000Z | backend/main.py | Plane-walker/fabric-draw | 7a3b4baef4d59a47c046e68d1fc5f20aeddd4c11 | [
"MIT"
] | null | null | null | import paramiko
import time
import io
import os
import stat
from yaml_generator import CAYamlGenerator, OrderYamlGenerator, PeerYamlGenerator, ConfigTXYamlGenerator
def sftp_get_r(sftp_client, remote_path, local_path):
try:
sftp_client.stat(remote_path)
except IOError:
return
if not os.pat... | 52.339181 | 232 | 0.632458 | import paramiko
import time
import io
import os
import stat
from yaml_generator import CAYamlGenerator, OrderYamlGenerator, PeerYamlGenerator, ConfigTXYamlGenerator
def sftp_get_r(sftp_client, remote_path, local_path):
try:
sftp_client.stat(remote_path)
except IOError:
return
if not os.pat... | true | true |
f7269dbe969bf3a3bdd44ac8ab46929aa9601789 | 2,670 | py | Python | import_metadata.py | arru/plex-utilities | b5ea04c090f1fdc008ae39239c1b03b435036acb | [
"BSD-3-Clause"
] | 1 | 2020-12-26T14:45:53.000Z | 2020-12-26T14:45:53.000Z | import_metadata.py | arru/plex-utilities | b5ea04c090f1fdc008ae39239c1b03b435036acb | [
"BSD-3-Clause"
] | null | null | null | import_metadata.py | arru/plex-utilities | b5ea04c090f1fdc008ae39239c1b03b435036acb | [
"BSD-3-Clause"
] | null | null | null | #!/usr/local/bin/python3
# https://python-plexapi.readthedocs.io/en/latest/modules/media.html
# https://github.com/liamks/libpytunes/blob/master/README.md
from os import path
import ImportUtils
CONFIGURATION = ImportUtils.get_configuration()
class FakePlexTrack:
originalTitle = ""
userRating = 0.0
year... | 30.689655 | 84 | 0.696629 |
from os import path
import ImportUtils
CONFIGURATION = ImportUtils.get_configuration()
class FakePlexTrack:
originalTitle = ""
userRating = 0.0
year = None
addedAt = ImportUtils.CURRENT_DATE
index = 0
lastViewedAt = None
title = ""
titleSort = None
viewCount = 0
def __in... | true | true |
f7269e3d1d7c351c9df854a7024d0200b141ab6d | 5,084 | py | Python | sdk/python/pulumi_azure_nextgen/authorization/latest/get_management_lock_at_resource_level.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/authorization/latest/get_management_lock_at_resource_level.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/authorization/latest/get_management_lock_at_resource_level.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 39.107692 | 283 | 0.648308 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
__all__ = [
'GetManagementLockAtResourceLevelResult',
'AwaitableGetManagementLockAtResourceLevelResult',
'get_management_lock_at_resou... | true | true |
f7269ea2093e6b0c5b7f64bb94961bc815827e61 | 6,713 | py | Python | misc/webdriver-w3c-tests/client/driver.py | zhuyongyong/crosswalk-test-suite | 24f3f8cfa663a365b0a22685d5bd096a637f72db | [
"BSD-3-Clause"
] | null | null | null | misc/webdriver-w3c-tests/client/driver.py | zhuyongyong/crosswalk-test-suite | 24f3f8cfa663a365b0a22685d5bd096a637f72db | [
"BSD-3-Clause"
] | null | null | null | misc/webdriver-w3c-tests/client/driver.py | zhuyongyong/crosswalk-test-suite | 24f3f8cfa663a365b0a22685d5bd096a637f72db | [
"BSD-3-Clause"
] | null | null | null | """Entry point for WebDriver."""
import alert
import command
import searchcontext
import webelement
import base64
class WebDriver(searchcontext.SearchContext):
"""Controls a web browser."""
def __init__(self, host, required, desired, mode='strict'):
args = {'desiredCapabilities': desired}
... | 33.565 | 80 | 0.58558 |
import alert
import command
import searchcontext
import webelement
import base64
class WebDriver(searchcontext.SearchContext):
def __init__(self, host, required, desired, mode='strict'):
args = {'desiredCapabilities': desired}
if required:
args['requiredCapabilities'] = required
... | true | true |
f7269ecfb8cc07dc1f1a6af43bc49083c18df9d2 | 938 | py | Python | mobilecoind/clients/python/lib/setup.py | mccobr/mobilecoin | cd7753a0aed838097b456d230151fb34e8cff034 | [
"Apache-2.0"
] | 140 | 2020-04-15T17:51:12.000Z | 2020-10-02T19:51:57.000Z | mobilecoind/clients/python/lib/setup.py | mccobr/mobilecoin | cd7753a0aed838097b456d230151fb34e8cff034 | [
"Apache-2.0"
] | 292 | 2020-10-22T00:34:35.000Z | 2022-03-29T09:29:14.000Z | mobilecoind/clients/python/lib/setup.py | mccobr/mobilecoin | cd7753a0aed838097b456d230151fb34e8cff034 | [
"Apache-2.0"
] | 32 | 2020-04-15T18:17:07.000Z | 2020-10-19T23:25:42.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="mobilecoin",
version="0.3.3",
author="MobileCoin",
author_email="support@mobilecoin.com",
description="Python bindings for the MobileCoin da... | 31.266667 | 104 | 0.670576 |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="mobilecoin",
version="0.3.3",
author="MobileCoin",
author_email="support@mobilecoin.com",
description="Python bindings for the MobileCoin daemon API.",
long_description=long_descrip... | true | true |
f7269f404c1a317ded575623966d09871ec4b217 | 9,554 | py | Python | samsungtvws/remote.py | chemelli74/samsung-tv-ws-api | bffbdd1796c95d5147117a5fc6583a803c310cd4 | [
"MIT"
] | null | null | null | samsungtvws/remote.py | chemelli74/samsung-tv-ws-api | bffbdd1796c95d5147117a5fc6583a803c310cd4 | [
"MIT"
] | null | null | null | samsungtvws/remote.py | chemelli74/samsung-tv-ws-api | bffbdd1796c95d5147117a5fc6583a803c310cd4 | [
"MIT"
] | null | null | null | """
SamsungTVWS - Samsung Smart TV WS API wrapper
Copyright (C) 2019 Xchwarze
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your op... | 34.366906 | 121 | 0.57578 | import base64
import json
import logging
import time
import ssl
import websocket
import requests
from . import exceptions
from . import shortcuts
_LOGGING = logging.getLogger(__name__)
class SamsungTVWS:
_URL_FORMAT = 'ws://{host}:{port}/api/v2/channels/samsung.remote.control?name={name}'
_SSL_URL_FORMAT = '... | true | true |
f726a064dd1bdc39f3586c546ec4b50d380b3919 | 2,492 | py | Python | tests/components/spc/test_init.py | tuxbox/home-assistant | df74272ba6311d527fd07198929c80a45d9fed15 | [
"Apache-2.0"
] | 1 | 2019-12-26T15:06:02.000Z | 2019-12-26T15:06:02.000Z | tests/components/spc/test_init.py | tuxbox/home-assistant | df74272ba6311d527fd07198929c80a45d9fed15 | [
"Apache-2.0"
] | null | null | null | tests/components/spc/test_init.py | tuxbox/home-assistant | df74272ba6311d527fd07198929c80a45d9fed15 | [
"Apache-2.0"
] | null | null | null | """Tests for Vanderbilt SPC component."""
from unittest.mock import patch, PropertyMock, Mock
from homeassistant.bootstrap import async_setup_component
from homeassistant.components.spc import DATA_API
from homeassistant.const import STATE_ALARM_ARMED_AWAY, STATE_ALARM_DISARMED
from tests.common import mock_coro
as... | 34.136986 | 85 | 0.702648 | from unittest.mock import patch, PropertyMock, Mock
from homeassistant.bootstrap import async_setup_component
from homeassistant.components.spc import DATA_API
from homeassistant.const import STATE_ALARM_ARMED_AWAY, STATE_ALARM_DISARMED
from tests.common import mock_coro
async def test_valid_device_config(hass, mon... | true | true |
f726a0e6a992cdb370f4db8314ec60bd087084f1 | 13,279 | py | Python | game-simulation/ctf01d-assistent.py | freehackquest/fhq-jury-ad | c839eefe98e5a6ccec6b182417f13929ebfe733a | [
"MIT"
] | 12 | 2018-09-28T10:57:10.000Z | 2020-03-30T15:53:05.000Z | game-simulation/ctf01d-assistent.py | freehackquest/fhq-jury-ad | c839eefe98e5a6ccec6b182417f13929ebfe733a | [
"MIT"
] | 32 | 2018-09-28T14:10:51.000Z | 2020-08-31T08:54:21.000Z | game-simulation/ctf01d-assistent.py | freehackquest/fhq-jury-ad | c839eefe98e5a6ccec6b182417f13929ebfe733a | [
"MIT"
] | 3 | 2018-09-28T14:21:41.000Z | 2019-11-02T14:14:34.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import docker
import sys
import os
import time
import datetime
# https://docker-py.readthedocs.io/en/latest/
client = docker.from_env()
progname = sys.argv[0]
# TODO read from data/config.yml
teams = [
{
"name": "team1",
"ip_prefix": "10.10.11"
... | 31.318396 | 115 | 0.568416 |
import docker
import sys
import os
import time
import datetime
client = docker.from_env()
progname = sys.argv[0]
teams = [
{
"name": "team1",
"ip_prefix": "10.10.11"
}, {
"name": "team2",
"ip_prefix": "10.10.12"
}, {
"name": "team3",
"ip_prefix": "10... | true | true |
f726a156e670ac369a860bc003d31ce52ead8fb6 | 9,807 | py | Python | sickbeard/lib/subliminal/services/itasa.py | Branlala/docker-sickbeardfr | 3ac85092dc4cc8a4171fb3c83e9682162245e13e | [
"MIT"
] | null | null | null | sickbeard/lib/subliminal/services/itasa.py | Branlala/docker-sickbeardfr | 3ac85092dc4cc8a4171fb3c83e9682162245e13e | [
"MIT"
] | null | null | null | sickbeard/lib/subliminal/services/itasa.py | Branlala/docker-sickbeardfr | 3ac85092dc4cc8a4171fb3c83e9682162245e13e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2012 Mr_Orange <mr_orange@hotmail.it>
#
# This file is part of subliminal.
#
# subliminal is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 3 of the Lice... | 45.402778 | 154 | 0.593862 |
from . import ServiceBase
from ..exceptions import DownloadFailedError, ServiceError
from ..cache import cachedmethod
from ..language import language_set, Language
from ..subtitles import get_subtitle_path, ResultSubtitle, EXTENSIONS
from ..utils import get_keywords
from ..videos import Episode
from bs... | true | true |
f726a158af6f84e4cbe621f9839c0a52a862440f | 478 | py | Python | Data Science With Python/06-importing-data-in-python-(part-2)/1-importing-data-from-the-internet/parsing-html-with-beautifulsoup.py | aimanahmedmoin1997/DataCamp | c6a6c4d59b83f14854bd76ed5c0c7f2dddd6de1d | [
"MIT"
] | 3 | 2019-05-12T04:49:24.000Z | 2020-05-06T00:40:28.000Z | Data Science With Python/06-importing-data-in-python-(part-2)/1-importing-data-from-the-internet/parsing-html-with-beautifulsoup.py | aimanahmedmoin1997/DataCamp | c6a6c4d59b83f14854bd76ed5c0c7f2dddd6de1d | [
"MIT"
] | null | null | null | Data Science With Python/06-importing-data-in-python-(part-2)/1-importing-data-from-the-internet/parsing-html-with-beautifulsoup.py | aimanahmedmoin1997/DataCamp | c6a6c4d59b83f14854bd76ed5c0c7f2dddd6de1d | [
"MIT"
] | 7 | 2018-11-06T17:43:31.000Z | 2020-11-07T21:08:16.000Z | # Import packages
import requests
from bs4 import BeautifulSoup
# Specify url: url
url = 'https://www.python.org/~guido/'
# Package the request, send the request and catch the response: r
r = requests.get(url)
# Extracts the response as html: html_doc
html_doc = r.text
# Create a BeautifulSoup object from the HTML:... | 21.727273 | 65 | 0.76569 |
import requests
from bs4 import BeautifulSoup
url = 'https://www.python.org/~guido/'
r = requests.get(url)
html_doc = r.text
soup = BeautifulSoup(html_doc)
pretty_soup = soup.prettify()
print(pretty_soup)
| true | true |
f726a169158c8afc5ef59a42f7606019f51270fd | 7,006 | py | Python | experiments/vitchyr/goal_distribution/representation_learning/exps_20_08_14/exp1_oracle_pygame_latent_reward_1ob.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2020-10-23T14:40:09.000Z | 2020-10-23T14:40:09.000Z | experiments/vitchyr/goal_distribution/representation_learning/exps_20_08_14/exp1_oracle_pygame_latent_reward_1ob.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/vitchyr/goal_distribution/representation_learning/exps_20_08_14/exp1_oracle_pygame_latent_reward_1ob.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2021-05-27T20:38:45.000Z | 2021-05-27T20:38:45.000Z | import rlkit.misc.hyperparameter as hyp
from multiworld.envs.pygame import PickAndPlaceEnv
from rlkit.launchers.launcher_util import run_experiment
from rlkit.torch.sets.rl_launcher import disco_experiment
if __name__ == "__main__":
variant = dict(
env_class=PickAndPlaceEnv,
env_kwargs=dict(
... | 32.137615 | 148 | 0.529403 | import rlkit.misc.hyperparameter as hyp
from multiworld.envs.pygame import PickAndPlaceEnv
from rlkit.launchers.launcher_util import run_experiment
from rlkit.torch.sets.rl_launcher import disco_experiment
if __name__ == "__main__":
variant = dict(
env_class=PickAndPlaceEnv,
env_kwargs=dict(
... | true | true |
f726a1bf8f792d5b4f9b9594c9f703b8b87a1151 | 1,391 | py | Python | geniza/footnotes/migrations/0015_add_footnote_location_pp.py | kmcelwee/geniza | 0e59134e35357d4f80d85bf1e423edbc29d1edfb | [
"Apache-2.0"
] | null | null | null | geniza/footnotes/migrations/0015_add_footnote_location_pp.py | kmcelwee/geniza | 0e59134e35357d4f80d85bf1e423edbc29d1edfb | [
"Apache-2.0"
] | 5 | 2020-09-22T17:35:24.000Z | 2020-09-22T19:45:46.000Z | geniza/footnotes/migrations/0015_add_footnote_location_pp.py | kmcelwee/geniza | 0e59134e35357d4f80d85bf1e423edbc29d1edfb | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.2.6 on 2021-12-15 21:28
from django.db import migrations
from django.db.models import F, Value
from django.db.models.functions import Concat
def add_pp_to_footnote_pages(apps, schema_editor):
# for footnotes that start with with a numeric location,
# we want to add pp. to make the mea... | 34.775 | 83 | 0.700216 |
from django.db import migrations
from django.db.models import F, Value
from django.db.models.functions import Concat
def add_pp_to_footnote_pages(apps, schema_editor):
Footnote = apps.get_model("footnotes", "Footnote")
Footnote.objects.filter(location__regex=r"^\d+$").update(... | true | true |
f726a26cfd9c320455025cb39ec2e30c2b3335a0 | 76,817 | py | Python | spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py | dan123456-eng/spyder | e57751e01d09a35b8f0583f9efd8dce318b17b4e | [
"MIT"
] | 1 | 2022-02-23T16:50:02.000Z | 2022-02-23T16:50:02.000Z | spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py | dan123456-eng/spyder | e57751e01d09a35b8f0583f9efd8dce318b17b4e | [
"MIT"
] | null | null | null | spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py | dan123456-eng/spyder | e57751e01d09a35b8f0583f9efd8dce318b17b4e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright © Spyder Project Contributors
#
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
# -----------------------------------------------------------------------------
"""
Te... | 34.743103 | 88 | 0.676777 |
import codecs
import glob
import os
import os.path as osp
import psutil
import shutil
import sys
import tempfile
from textwrap import dedent
import threading
import traceback
from unittest.mock import Mock
import IPython
from IPython.core import release as ipy_release
from IPython.core.application import ge... | true | true |
f726a2f4cad617630bb938793f65f75b2ac968fa | 5,832 | py | Python | src/ruvsarpur/ruv_client.py | HaukurPall/ruvsarpur | bf9befe37aa8c38e7b056372e11bb0f6450497a2 | [
"MIT"
] | null | null | null | src/ruvsarpur/ruv_client.py | HaukurPall/ruvsarpur | bf9befe37aa8c38e7b056372e11bb0f6450497a2 | [
"MIT"
] | null | null | null | src/ruvsarpur/ruv_client.py | HaukurPall/ruvsarpur | bf9befe37aa8c38e7b056372e11bb0f6450497a2 | [
"MIT"
] | null | null | null | import asyncio
import json
import logging
from pathlib import Path
from typing import Dict, List, TypedDict
from gql import Client, gql
from gql.client import AsyncClientSession
from gql.transport.aiohttp import AIOHTTPTransport
log = logging.getLogger(__name__)
class Episode(TypedDict):
id: str
title: str
... | 33.325714 | 122 | 0.558471 | import asyncio
import json
import logging
from pathlib import Path
from typing import Dict, List, TypedDict
from gql import Client, gql
from gql.client import AsyncClientSession
from gql.transport.aiohttp import AIOHTTPTransport
log = logging.getLogger(__name__)
class Episode(TypedDict):
id: str
title: str
... | true | true |
f726a329312efb2fda886586854705d5e3adad9f | 6,532 | py | Python | listWrangler_20191216.py | LukeHebert/genelist_overlap | 5275e9b1d8d5dae2a78b76aed42925bdd4914418 | [
"MIT"
] | null | null | null | listWrangler_20191216.py | LukeHebert/genelist_overlap | 5275e9b1d8d5dae2a78b76aed42925bdd4914418 | [
"MIT"
] | null | null | null | listWrangler_20191216.py | LukeHebert/genelist_overlap | 5275e9b1d8d5dae2a78b76aed42925bdd4914418 | [
"MIT"
] | null | null | null | '''
Author: Luke Hebert
Date begun: December 16th, 2019
Description: finds either the intersection, union, or unique items from a set of n lists
especially useful for comparing lists of genes
inputs for unique option need to be .txt files; this could be easily tweaked though
all input and output are forced to upper ... | 48.746269 | 150 | 0.729026 |
import os, sys
def getContents(paths_list):
contents_dict = {}
for file in paths_list:
contents_dict[file] = []
with open(file, 'r') as inFile:
for line in inFile:
line = line.strip('\n').strip('\r')
contents_dict[file].append(line.upper())
return contents_dict
slash = '\\' if os.name == 'nt' else ... | true | true |
f726a386b1ac9288db05e33cf07f7a65824e7d28 | 1,805 | py | Python | dataset_utils/check_bg_layer.py | ArthurWish/mmdetection | bd4c5b04e9d880f7a38131f17d3b43e4a3630c4f | [
"Apache-2.0"
] | null | null | null | dataset_utils/check_bg_layer.py | ArthurWish/mmdetection | bd4c5b04e9d880f7a38131f17d3b43e4a3630c4f | [
"Apache-2.0"
] | null | null | null | dataset_utils/check_bg_layer.py | ArthurWish/mmdetection | bd4c5b04e9d880f7a38131f17d3b43e4a3630c4f | [
"Apache-2.0"
] | null | null | null | import os
from PIL import Image, ImageDraw
from tqdm import tqdm
def label_bg_layer(img_path, label_path, img_type):
bg_data_list = os.listdir(img_path)
label_list = os.listdir(label_path)
label_prefix_list = []
for label in label_list:
label = os.path.splitext(label)[0]
label_prefix_li... | 41.022727 | 117 | 0.532964 | import os
from PIL import Image, ImageDraw
from tqdm import tqdm
def label_bg_layer(img_path, label_path, img_type):
bg_data_list = os.listdir(img_path)
label_list = os.listdir(label_path)
label_prefix_list = []
for label in label_list:
label = os.path.splitext(label)[0]
label_prefix_li... | true | true |
f726a3f0bc85a62b7c621cc217d1f66bc6ba1017 | 4,272 | py | Python | etl/deaths.py | icane/demographic-indicators | b1c394a4497e8e4c0189bf4c0518ce38fb873d4c | [
"Apache-2.0"
] | null | null | null | etl/deaths.py | icane/demographic-indicators | b1c394a4497e8e4c0189bf4c0518ce38fb873d4c | [
"Apache-2.0"
] | 1 | 2022-01-18T11:01:29.000Z | 2022-01-18T11:01:29.000Z | etl/deaths.py | icane/demographic-indicators | b1c394a4497e8e4c0189bf4c0518ce38fb873d4c | [
"Apache-2.0"
] | null | null | null | """Deaths indicators."""
from etl.common import to_json_stat, write_to_file
from etl.config_deaths import deaths_cfg as cfg
from etlstat.extractor.extractor import xlsx
import json
import pandas as pd
def transform(df, periods, prefix=''):
"""Slice dataframe. Generate time period column.
df (dat... | 33.637795 | 75 | 0.612125 |
from etl.common import to_json_stat, write_to_file
from etl.config_deaths import deaths_cfg as cfg
from etlstat.extractor.extractor import xlsx
import json
import pandas as pd
def transform(df, periods, prefix=''):
for i in range(0, len(df)):
period1 = str(df.loc[i, 'Año'])
period2 = '{:0>2}'... | true | true |
f726a514c5af450b08e924325a355027db5b2bb3 | 2,355 | py | Python | tests/test_payment_chargebacks.py | elcolumbio/mollie-api-python | 743c7c10df5916bfa14e2c4e82ad5cca17bc2ae3 | [
"BSD-2-Clause"
] | null | null | null | tests/test_payment_chargebacks.py | elcolumbio/mollie-api-python | 743c7c10df5916bfa14e2c4e82ad5cca17bc2ae3 | [
"BSD-2-Clause"
] | 3 | 2018-09-21T12:02:44.000Z | 2018-09-26T12:01:00.000Z | tests/test_payment_chargebacks.py | elcolumbio/mollie-api-python | 743c7c10df5916bfa14e2c4e82ad5cca17bc2ae3 | [
"BSD-2-Clause"
] | null | null | null | from mollie.api.objects.chargeback import Chargeback
from .utils import assert_list_object
PAYMENT_ID = 'tr_7UhSN1zuXS'
CHARGEBACK_ID = 'chb_n9z0tp'
def test_get_payment_chargebacks_by_payment_id(client, response):
"""Get chargebacks relevant to payment by payment id."""
response.get('https://api.mollie.com... | 45.288462 | 102 | 0.745648 | from mollie.api.objects.chargeback import Chargeback
from .utils import assert_list_object
PAYMENT_ID = 'tr_7UhSN1zuXS'
CHARGEBACK_ID = 'chb_n9z0tp'
def test_get_payment_chargebacks_by_payment_id(client, response):
response.get('https://api.mollie.com/v2/payments/%s/chargebacks' % PAYMENT_ID, 'chargebacks_list'... | true | true |
f726a8242f8fd6b97a2dbc1d66d1b2ffa30955db | 4,308 | py | Python | probability_combinatorics/linear_regression.py | codecakes/random_games | 1e670021ec97a196726e937e658878dc63ba9d34 | [
"MIT"
] | null | null | null | probability_combinatorics/linear_regression.py | codecakes/random_games | 1e670021ec97a196726e937e658878dc63ba9d34 | [
"MIT"
] | null | null | null | probability_combinatorics/linear_regression.py | codecakes/random_games | 1e670021ec97a196726e937e658878dc63ba9d34 | [
"MIT"
] | null | null | null | from math import sqrt
from itertools import izip
from numpy import mean
from py_variance_std import t_percentile
def calc_slope(r, sdy, sdx): return r * (float(sdy)/sdx)
def line_fitting(x_arr, y_arr):
"""
using straight line y = mx + c;
m(of a sample data points) = Covariance(X,Y)/Covariance(X,X) =
... | 35.311475 | 154 | 0.669452 | from math import sqrt
from itertools import izip
from numpy import mean
from py_variance_std import t_percentile
def calc_slope(r, sdy, sdx): return r * (float(sdy)/sdx)
def line_fitting(x_arr, y_arr):
xbar = mean(x_arr)
ybar = mean(y_arr)
xsqr_bar = mean([i**2 for i in x_arr])
xybar = mean([i*j for ... | true | true |
f726a835b02eb3b1ea4dadc3134351ab0143ad58 | 1,806 | py | Python | tools/photon_yield.py | LeoRoweBrown/ckvpy | fff27847f5577750ae5860e3fdff81877fa4455a | [
"MIT"
] | null | null | null | tools/photon_yield.py | LeoRoweBrown/ckvpy | fff27847f5577750ae5860e3fdff81877fa4455a | [
"MIT"
] | null | null | null | tools/photon_yield.py | LeoRoweBrown/ckvpy | fff27847f5577750ae5860e3fdff81877fa4455a | [
"MIT"
] | null | null | null | import numpy as np
from scipy.integrate import simps
import scipy.constants as const
def compute(theta_in, f, beta, L, n=None):
"""compute number of photons due to Frank-Tamm and Fresen equations
theta (ndarray/list[float]): Angles in chosen wavelength range
f (ndarray/list[float]): Frequencies in chosen w... | 42 | 73 | 0.633444 | import numpy as np
from scipy.integrate import simps
import scipy.constants as const
def compute(theta_in, f, beta, L, n=None):
if n is None:
print("Using Cherenkov angle to derive n instead of d(omega)/dk")
n = 1/(beta*np.cos(theta_in))
r_s = np.absolute(
(n*np.cos(theta_in) - np.sqrt(... | true | true |
f726a842f0367a5bce40537953cbd52aa33b1909 | 4,830 | py | Python | model/network.py | andrewschreiber/numpy-saliency | 2e788a1150f6e160f2271cbb4f20747559f243c0 | [
"MIT"
] | 10 | 2019-07-30T02:36:21.000Z | 2020-12-22T06:35:40.000Z | model/network.py | andrewschreiber/numpy-saliency | 2e788a1150f6e160f2271cbb4f20747559f243c0 | [
"MIT"
] | 6 | 2019-08-09T02:17:38.000Z | 2022-03-11T23:56:24.000Z | model/network.py | andrewschreiber/numpy-saliency | 2e788a1150f6e160f2271cbb4f20747559f243c0 | [
"MIT"
] | 2 | 2019-08-03T08:38:26.000Z | 2020-06-29T12:58:47.000Z | import numpy as np
import pickle
from model.loss import cross_entropy
from model.layers import Conv2D, Maxpool2D, Dense, Flatten, ReLu, Softmax
class LeNet5:
"""Implementation of LeNet 5 for MNIST
http://yann.lecun.com/exdb/publis/pdf/lecun-98.pdf
"""
def __init__(self, weights_path=None):
... | 38.951613 | 79 | 0.522774 | import numpy as np
import pickle
from model.loss import cross_entropy
from model.layers import Conv2D, Maxpool2D, Dense, Flatten, ReLu, Softmax
class LeNet5:
def __init__(self, weights_path=None):
lr = 0.01
layers = []
layers.append(Conv2D(n_filter=6, n_channel=1,
... | true | true |
f726aa04174ce7bf2f5c510516bdd17021d883d8 | 6,175 | py | Python | deepecg/training/model/disc/model.py | Seb-Good/deepecg | c99fbe80718ee9969936154ae2c1a04d81c9b246 | [
"MIT"
] | 56 | 2019-02-20T04:47:25.000Z | 2022-03-23T01:12:43.000Z | deepecg/training/model/disc/model.py | vivektalwar13071999/deepecg | c99fbe80718ee9969936154ae2c1a04d81c9b246 | [
"MIT"
] | 7 | 2019-12-16T20:59:36.000Z | 2022-02-09T23:48:59.000Z | deepecg/training/model/disc/model.py | vivektalwar13071999/deepecg | c99fbe80718ee9969936154ae2c1a04d81c9b246 | [
"MIT"
] | 22 | 2019-02-24T02:57:20.000Z | 2022-03-23T01:12:49.000Z | """
model.py
--------
This module provides a class and methods for building and managing a model with tensorflow.
By: Sebastian D. Goodfellow, Ph.D., 2018
"""
# Compatibility imports
from __future__ import absolute_import, division, print_function
# 3rd party imports
import os
import sys
import json
import pickle
imp... | 35.488506 | 117 | 0.674494 |
from __future__ import absolute_import, division, print_function
import os
import sys
import json
import pickle
import tensorflow as tf
from deepecg.training.model.disc.graph import Graph
from deepecg.training.networks.deep_ecg_v1 import DeepECGV1
from deepecg.training.networks.deep_ecg_v2 import DeepECGV2
from d... | true | true |
f726aa89dee842342ea1bd383144960b734ac342 | 607 | py | Python | setup.py | Yoshiki443/weather_parameters | ae2c9ed02f68968cb6ea0610d556f3c68bbc923e | [
"MIT"
] | 17 | 2020-04-26T20:25:56.000Z | 2022-03-10T09:41:54.000Z | setup.py | Yoshiki443/weather_parameters | ae2c9ed02f68968cb6ea0610d556f3c68bbc923e | [
"MIT"
] | null | null | null | setup.py | Yoshiki443/weather_parameters | ae2c9ed02f68968cb6ea0610d556f3c68bbc923e | [
"MIT"
] | 1 | 2020-06-08T04:54:30.000Z | 2020-06-08T04:54:30.000Z | import setuptools
setuptools.setup(
name="wxparams",
version="1.5",
author="Yoshiki Kato",
# author_email="",
description="Weather Parameters Calculator",
long_description="This is a python module for calculating meteorological parameters.",
long_description_content_type="text/markdown",
... | 30.35 | 90 | 0.678748 | import setuptools
setuptools.setup(
name="wxparams",
version="1.5",
author="Yoshiki Kato",
description="Weather Parameters Calculator",
long_description="This is a python module for calculating meteorological parameters.",
long_description_content_type="text/markdown",
url="https://git... | true | true |
f726aacd3954efc8b82de1b378ebd375941886de | 6,348 | py | Python | Testing/ND-Testing.py | garibaldu/boundary-seekers | 441fea01e93de882bf22e0deb411f0b10602fa37 | [
"MIT"
] | null | null | null | Testing/ND-Testing.py | garibaldu/boundary-seekers | 441fea01e93de882bf22e0deb411f0b10602fa37 | [
"MIT"
] | null | null | null | Testing/ND-Testing.py | garibaldu/boundary-seekers | 441fea01e93de882bf22e0deb411f0b10602fa37 | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
def __perms(n):
if not n:
return
p = []
for i in range(0, 2**n):
s = bin(i)[2:]
s = "0" * (n-len(s)) + s
s_prime = np.array(list(map(lambda x: int(x), list(s))))
p.append(s_prime)
return p
def care(normal, bias, exa... | 29.943396 | 150 | 0.594045 | import numpy as np
import tensorflow as tf
def __perms(n):
if not n:
return
p = []
for i in range(0, 2**n):
s = bin(i)[2:]
s = "0" * (n-len(s)) + s
s_prime = np.array(list(map(lambda x: int(x), list(s))))
p.append(s_prime)
return p
def care(normal, bias, exa... | true | true |
f726aafdc70d344f7835f59ea676ff8263ce502c | 6,600 | py | Python | Lib/site-packages/wx-2.8-msw-unicode/wx/tools/XRCed/plugins/xh_gizmos.py | ekkipermana/robotframework-test | 243ca26f69962f8cf20cd7d054e0ff3e709bc7f4 | [
"bzip2-1.0.6"
] | 27 | 2020-11-12T19:24:54.000Z | 2022-03-27T23:10:45.000Z | Lib/site-packages/wx-2.8-msw-unicode/wx/tools/XRCed/plugins/xh_gizmos.py | ekkipermana/robotframework-test | 243ca26f69962f8cf20cd7d054e0ff3e709bc7f4 | [
"bzip2-1.0.6"
] | 2 | 2020-11-02T06:30:39.000Z | 2022-02-23T18:39:55.000Z | Lib/site-packages/wx-2.8-msw-unicode/wx/tools/XRCed/plugins/xh_gizmos.py | ekkipermana/robotframework-test | 243ca26f69962f8cf20cd7d054e0ff3e709bc7f4 | [
"bzip2-1.0.6"
] | 7 | 2018-02-13T10:22:39.000Z | 2019-07-04T07:39:28.000Z | # Name: gizmos.py
# Purpose: XML handlers for wx.gismos classes
# Author: Roman Rolinsky <rolinsky@femagsoft.com>
# Created: 09.07.2007
# RCS-ID: $Id$
import wx
import wx.xrc as xrc
import wx.gizmos as gizmos
class LEDNumberCtrlXmlHandler(xrc.XmlResourceHandler):
def __init__(self):
... | 39.285714 | 86 | 0.601667 |
import wx
import wx.xrc as xrc
import wx.gizmos as gizmos
class LEDNumberCtrlXmlHandler(xrc.XmlResourceHandler):
def __init__(self):
xrc.XmlResourceHandler.__init__(self)
self.AddWindowStyles()
self.AddStyle('wxLED_ALIGN_LEFT', gizmos.LED_ALIGN_LEFT)
self.Add... | true | true |
f726ab4ccfc111179e65303e6251acccc8a648d5 | 4,241 | py | Python | loot_tables.py | Battlecats59/MCBELootRandomizer | de5c49c65fb12c1e3ec391b665bdfd9a5c64c7cc | [
"MIT"
] | null | null | null | loot_tables.py | Battlecats59/MCBELootRandomizer | de5c49c65fb12c1e3ec391b665bdfd9a5c64c7cc | [
"MIT"
] | null | null | null | loot_tables.py | Battlecats59/MCBELootRandomizer | de5c49c65fb12c1e3ec391b665bdfd9a5c64c7cc | [
"MIT"
] | null | null | null | import os
import json
import yaml
from typing import OrderedDict
from yaml.loader import FullLoader
from paths import RANDO_ROOT_PATH
class loot_tables:
def get_loot_tables(self, options):
with (RANDO_ROOT_PATH / 'loot_table_categories.yaml').open('r') as loot_tables:
self.loot_table_list = y... | 47.651685 | 169 | 0.680736 | import os
import json
import yaml
from typing import OrderedDict
from yaml.loader import FullLoader
from paths import RANDO_ROOT_PATH
class loot_tables:
def get_loot_tables(self, options):
with (RANDO_ROOT_PATH / 'loot_table_categories.yaml').open('r') as loot_tables:
self.loot_table_list = y... | true | true |
f726ad04313fae09750869fe143024d0fb1c7b02 | 1,794 | py | Python | release/stubs.min/System/Drawing/__init___parts/CopyPixelOperation.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/System/Drawing/__init___parts/CopyPixelOperation.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/System/Drawing/__init___parts/CopyPixelOperation.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | class CopyPixelOperation(Enum,IComparable,IFormattable,IConvertible):
"""
Determines how the source color in a copy pixel operation is combined with the destination color to result in a final color.
enum CopyPixelOperation,values: Blackness (66),CaptureBlt (1073741824),DestinationInvert (5570569),MergeCopy (... | 33.849057 | 411 | 0.726867 | class CopyPixelOperation(Enum,IComparable,IFormattable,IConvertible):
return CopyPixelOperation()
def __eq__(self,*args):
""" x.__eq__(y) <==> x==yx.__eq__(y) <==> x==yx.__eq__(y) <==> x==y """
pass
""" __format__(formattable: IFormattable,format: str) -> str """
pass
pass
def __gt__(self,*args):
... | true | true |
f726ad8c7093593009fdde16473a6c6d5e036bd8 | 11,476 | py | Python | python/GUI/__main__.py | andreehultgren/soduko | aae2d174e417d00ed60206f4567e554d25aa4311 | [
"MIT"
] | null | null | null | python/GUI/__main__.py | andreehultgren/soduko | aae2d174e417d00ed60206f4567e554d25aa4311 | [
"MIT"
] | null | null | null | python/GUI/__main__.py | andreehultgren/soduko | aae2d174e417d00ed60206f4567e554d25aa4311 | [
"MIT"
] | null | null | null | import pygame
from random import sample, randint, random
from tabulate import tabulate
config = {
"cell_width" : 50,
"cell_height" : 50,
"cell_color" : (235,235,235),
"cell_color_hover" : (220,220,255),
... | 36.08805 | 174 | 0.548013 | import pygame
from random import sample, randint, random
from tabulate import tabulate
config = {
"cell_width" : 50,
"cell_height" : 50,
"cell_color" : (235,235,235),
"cell_color_hover" : (220,220,255),
... | true | true |
f726af04dc7785db1b54ef4a6b8f7b5c33ebd894 | 878 | py | Python | server/fadzmaq.py | lachierussell/FadZmaq | deb89c35df05603552ce95627ac8400c6788fbcb | [
"BSD-2-Clause"
] | 2 | 2019-09-02T06:56:46.000Z | 2019-09-15T08:43:54.000Z | server/fadzmaq.py | lachierussell/FadZmaq | deb89c35df05603552ce95627ac8400c6788fbcb | [
"BSD-2-Clause"
] | 11 | 2019-08-27T19:08:24.000Z | 2019-10-18T01:45:54.000Z | server/fadzmaq.py | lachierussell/FadZmaq | deb89c35df05603552ce95627ac8400c6788fbcb | [
"BSD-2-Clause"
] | 1 | 2019-10-25T05:42:48.000Z | 2019-10-25T05:42:48.000Z | # @file
# The application entry point. Run this file to use the FadZmaq Server.
#
# FadZmaq Project
# Professional Computing. Semester 2 2019
#
# Copyright FadZmaq © 2019 All rights reserved.
# @author Lachlan Russell 22414249@student.uwa.edu.au
# @author Jordan Russell jordanrussell@live.com
# @autho... | 30.275862 | 71 | 0.750569 |
from fadzmaq import create_app
import fadzmaq
import firebase_admin
from sqlalchemy import create_engine
app = create_app()
cred = firebase_admin.credentials.Certificate(app.config['CERT'])
fadzmaq.auth_app = firebase_admin.initialize_app(cred)
fadzmaq.engine = create_engine(app.config['DATABASE_URI'])
... | true | true |
f726b000f7751f551512bc88f402ed4f784b69c2 | 6,428 | py | Python | dev/breeze/src/airflow_breeze/build_image/ci/build_ci_params.py | npodewitz/airflow | 511ea702d5f732582d018dad79754b54d5e53f9d | [
"Apache-2.0"
] | null | null | null | dev/breeze/src/airflow_breeze/build_image/ci/build_ci_params.py | npodewitz/airflow | 511ea702d5f732582d018dad79754b54d5e53f9d | [
"Apache-2.0"
] | null | null | null | dev/breeze/src/airflow_breeze/build_image/ci/build_ci_params.py | npodewitz/airflow | 511ea702d5f732582d018dad79754b54d5e53f9d | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 35.125683 | 104 | 0.706752 |
import os
from dataclasses import dataclass
from datetime import datetime
from pathlib import Path
from typing import List, Optional
from airflow_breeze.branch_defaults import AIRFLOW_BRANCH, DEFAULT_AIRFLOW_CONSTRAINTS_BRANCH
from airflow_breeze.global_constants import get_airflow_version
from airflow... | true | true |
f726b031d40348c933768960ba80fab387456438 | 356 | py | Python | src/grasshopper_combat.py | hcodydibble/code-katas | f02599a76ac5c3719b1e3831208126eb4b72e98d | [
"MIT"
] | null | null | null | src/grasshopper_combat.py | hcodydibble/code-katas | f02599a76ac5c3719b1e3831208126eb4b72e98d | [
"MIT"
] | null | null | null | src/grasshopper_combat.py | hcodydibble/code-katas | f02599a76ac5c3719b1e3831208126eb4b72e98d | [
"MIT"
] | null | null | null | """Grasshopper - Terminal game combat function - Return remaining health after
taking damage.
# 1 Best Practices solution by ZozoFouchtra and others
def combat(health, damage):
return max(0, health-damage)
"""
def combat(health, damage):
"""Find remaining health after taking damage."""
return 0 if healt... | 25.428571 | 78 | 0.724719 |
def combat(health, damage):
return 0 if health - damage < 0 else health - damage
| true | true |
f726b1139d55db10b37ce1d0847019a581954a25 | 4,460 | py | Python | sdks/python/apache_beam/io/gcp/bigquery_avro_tools.py | eyal0/beam | 9c6922976cc2a5c6a2ef836c1986ff769cda99a5 | [
"Apache-2.0"
] | 2 | 2017-12-19T18:34:54.000Z | 2019-05-14T21:50:06.000Z | sdks/python/apache_beam/io/gcp/bigquery_avro_tools.py | eyal0/beam | 9c6922976cc2a5c6a2ef836c1986ff769cda99a5 | [
"Apache-2.0"
] | 80 | 2020-01-16T09:55:09.000Z | 2020-10-03T13:43:07.000Z | sdks/python/apache_beam/io/gcp/bigquery_avro_tools.py | eyal0/beam | 9c6922976cc2a5c6a2ef836c1986ff769cda99a5 | [
"Apache-2.0"
] | 1 | 2020-04-29T20:09:40.000Z | 2020-04-29T20:09:40.000Z | #
# 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 us... | 31.631206 | 180 | 0.679596 |
from __future__ import absolute_import
from __future__ import division
{
"STRUCT": "record",
"RECORD": "record",
"STRING": "string",
"BOOL": "boolean",
"BOOLEAN": "boolean",
"BYTES": "bytes",
"FLOAT64": "double",
"FLOAT": "double",
"INT64": "long",
"INTEGER... | true | true |
f726b1967d8348b9c13635036359c128ffc392c3 | 750 | py | Python | src/language/Perl.py | fearless-spider/repo_info_extractor | fd9301d9ea637df19dcc015e70c300e2eea54a45 | [
"MIT"
] | 2 | 2019-11-27T15:21:42.000Z | 2020-12-12T15:17:42.000Z | src/language/Perl.py | fearless-spider/repo_info_extractor | fd9301d9ea637df19dcc015e70c300e2eea54a45 | [
"MIT"
] | null | null | null | src/language/Perl.py | fearless-spider/repo_info_extractor | fd9301d9ea637df19dcc015e70c300e2eea54a45 | [
"MIT"
] | null | null | null | import re
def extract_libraries(files):
"""Extracts a list of imports that were used in the files
Parameters
----------
files : []string
Full paths to files that need to be analysed
Returns
-------
dict
imports that were used in the provided files, mapped against the langu... | 24.193548 | 120 | 0.536 | import re
def extract_libraries(files):
res = []
regex = re.compile(r"(?:[^#]\s+)(?:use|require)[^\S\n]+(?:if.*,\s+)?[\"']?([a-zA-Z][a-zA-Z0-9:]*)[\"']?(?:\s+.*)?;")
for f in files:
with open(file=f, mode='r', errors='ignore') as fr:
contents = ' '.join(fr.readlines())
... | true | true |
f726b22a3876f904a6f1d950541f05c40c664edb | 4,607 | py | Python | python_gyg/tests/test_location.py | fukac99/python_gyg | 2722da1b2a858336fff584af5acc3e78135ab8a1 | [
"MIT"
] | 1 | 2019-05-22T19:37:16.000Z | 2019-05-22T19:37:16.000Z | python_gyg/tests/test_location.py | fukac99/python_gyg | 2722da1b2a858336fff584af5acc3e78135ab8a1 | [
"MIT"
] | null | null | null | python_gyg/tests/test_location.py | fukac99/python_gyg | 2722da1b2a858336fff584af5acc3e78135ab8a1 | [
"MIT"
] | null | null | null | from unittest import TestCase
import python_gyg
import datetime
GYG_API_KEY = "<your_api_key>"
class TestLocation(TestCase):
def test_is_GetYourGuide_isntance(self):
s = python_gyg.GetYourGuide(GYG_API_KEY)
self.assertTrue(isinstance(s, python_gyg.GetYourGuide))
# def test_get_locatio... | 45.166667 | 119 | 0.682223 | from unittest import TestCase
import python_gyg
import datetime
GYG_API_KEY = "<your_api_key>"
class TestLocation(TestCase):
def test_is_GetYourGuide_isntance(self):
s = python_gyg.GetYourGuide(GYG_API_KEY)
self.assertTrue(isinstance(s, python_gyg.GetYourGuide))
def test_... | true | true |
f726b366c9cf2b7cd4cfde6038b4f205fcd52e43 | 1,036 | py | Python | vyperlogix/zlib/zlibCompressor.py | raychorn/chrome_gui | f1fade70b61af12ee43c55c075aa9cfd32caa962 | [
"CC0-1.0"
] | 1 | 2020-09-29T01:36:33.000Z | 2020-09-29T01:36:33.000Z | vyperlogix/zlib/zlibCompressor.py | raychorn/chrome_gui | f1fade70b61af12ee43c55c075aa9cfd32caa962 | [
"CC0-1.0"
] | null | null | null | vyperlogix/zlib/zlibCompressor.py | raychorn/chrome_gui | f1fade70b61af12ee43c55c075aa9cfd32caa962 | [
"CC0-1.0"
] | null | null | null | import gzip, zlib, base64
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
__copyright__ = """\
(c). Copyright 2008-2020, Vyper Logix Corp., All Rights Reserved.
Published under Creative Commons License
(http://creativecommons.org/licenses/by-nc/3.0/)
restricted to non-... | 31.393939 | 70 | 0.779923 | import gzip, zlib, base64
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
__copyright__ = """\
(c). Copyright 2008-2020, Vyper Logix Corp., All Rights Reserved.
Published under Creative Commons License
(http://creativecommons.org/licenses/by-nc/3.0/)
restricted to non-... | true | true |
f726b54f3a46ebdee086c417557534ca46be6aee | 1,875 | py | Python | examples/pacman/independent.py | okkhoy/rlpy | af25d2011fff1d61cb7c5cc8992549808f0c6103 | [
"BSD-3-Clause"
] | 265 | 2015-01-21T08:11:12.000Z | 2021-12-21T08:06:21.000Z | examples/pacman/independent.py | okkhoy/rlpy | af25d2011fff1d61cb7c5cc8992549808f0c6103 | [
"BSD-3-Clause"
] | 22 | 2015-03-26T17:41:43.000Z | 2019-12-19T08:47:36.000Z | examples/pacman/independent.py | okkhoy/rlpy | af25d2011fff1d61cb7c5cc8992549808f0c6103 | [
"BSD-3-Clause"
] | 85 | 2015-02-18T00:25:15.000Z | 2021-11-15T11:10:00.000Z | """
Cart-pole balancing with independent discretization
"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from rlpy.Domains import Pacman
from rlp... | 32.894737 | 98 | 0.700267 | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from rlpy.Domains import Pacman
from rlpy.Agents import Q_Learning
from rlpy.Representations import ... | true | true |
f726b5f40791ce2171ac294bd9cf1073746baf44 | 2,896 | py | Python | saleor/checkout/views/discount.py | dedhio/bellastore | 03cad4d11c039c6c33291021def812570c09fe36 | [
"BSD-3-Clause"
] | 3 | 2019-06-09T18:00:54.000Z | 2019-06-18T10:07:39.000Z | saleor/checkout/views/discount.py | dedhio/bellastore | 03cad4d11c039c6c33291021def812570c09fe36 | [
"BSD-3-Clause"
] | 2 | 2019-07-03T21:08:32.000Z | 2019-08-06T02:09:26.000Z | saleor/checkout/views/discount.py | dedhio/bellastore | 03cad4d11c039c6c33291021def812570c09fe36 | [
"BSD-3-Clause"
] | 1 | 2021-04-03T10:47:36.000Z | 2021-04-03T10:47:36.000Z | from datetime import date
from functools import wraps
from django.contrib import messages
from django.shortcuts import redirect
from django.template.response import TemplateResponse
from django.utils.translation import pgettext
from django.views.decorators.http import require_POST
from ...discount.models import Vouch... | 34.070588 | 80 | 0.658494 | from datetime import date
from functools import wraps
from django.contrib import messages
from django.shortcuts import redirect
from django.template.response import TemplateResponse
from django.utils.translation import pgettext
from django.views.decorators.http import require_POST
from ...discount.models import Vouch... | true | true |
f726b60b2e30efcf835322d9c0d038acf405f3ab | 895 | py | Python | 086.py | zlsun/ProjectEuler | 813ec545484924a052f1bd7fd90a4c676eea3bba | [
"MIT"
] | null | null | null | 086.py | zlsun/ProjectEuler | 813ec545484924a052f1bd7fd90a4c676eea3bba | [
"MIT"
] | null | null | null | 086.py | zlsun/ProjectEuler | 813ec545484924a052f1bd7fd90a4c676eea3bba | [
"MIT"
] | null | null | null | #-*- encoding: utf-8 -*-
"""
Cuboid route
A spider, S, sits in one corner of a cuboid room, measuring 6 by 5 by 3, and a fly, F, sits in the opposite corner. By travelling on the surfaces of the room the shortest "straight line" distance from S to F is 10 and the path is shown on the diagram.
However, there are up ... | 49.722222 | 341 | 0.75419 |
from utils import *
| true | true |
f726b71c0d372ca68b0e214f1e0ae937fead58bb | 642 | py | Python | url_migration/management/commands/remove_expired_redirects.py | riklaunim/django-url-migration | 0d1115d02b64a895934ecdd7387e65b34b3d68e7 | [
"BSD-3-Clause"
] | 4 | 2017-04-28T18:58:31.000Z | 2017-10-04T07:32:47.000Z | url_migration/management/commands/remove_expired_redirects.py | riklaunim/django-url-migration | 0d1115d02b64a895934ecdd7387e65b34b3d68e7 | [
"BSD-3-Clause"
] | 3 | 2021-04-23T11:30:49.000Z | 2021-04-26T14:12:29.000Z | url_migration/management/commands/remove_expired_redirects.py | riklaunim/django-url-migration | 0d1115d02b64a895934ecdd7387e65b34b3d68e7 | [
"BSD-3-Clause"
] | 1 | 2021-04-23T11:07:36.000Z | 2021-04-23T11:07:36.000Z | from django.core.management.base import BaseCommand
from django.utils import timezone
from url_migration import models
class Command(BaseCommand):
def handle(self, **options):
for rule in models.UrlRegexpMapping.objects.filter(last_usage__isnull=False):
self._remove_if_unused(rule)
fo... | 35.666667 | 85 | 0.71028 | from django.core.management.base import BaseCommand
from django.utils import timezone
from url_migration import models
class Command(BaseCommand):
def handle(self, **options):
for rule in models.UrlRegexpMapping.objects.filter(last_usage__isnull=False):
self._remove_if_unused(rule)
fo... | true | true |
f726b73d345c483e69c29ca4afc5bfc2e99d7b7f | 4,201 | py | Python | fellowship/contract_generator.py | nokia/contract-test-framework | 67976b3361b1bb28639059720d247987ff203224 | [
"BSD-3-Clause"
] | 2 | 2021-10-05T06:47:07.000Z | 2022-03-03T23:34:50.000Z | fellowship/contract_generator.py | nokia/contract-test-framework | 67976b3361b1bb28639059720d247987ff203224 | [
"BSD-3-Clause"
] | 10 | 2021-09-02T06:58:55.000Z | 2021-12-03T19:21:39.000Z | fellowship/contract_generator.py | nokia/contract-test-framework | 67976b3361b1bb28639059720d247987ff203224 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2021 Nokia
# Licensed under the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
import json
import logging
import os
from urllib.parse import urlparse
from genson import SchemaBuilder
from .contract_renderer import ContractRenderer
from .strict_schema_builder import StrictSchema... | 42.434343 | 89 | 0.660081 |
import json
import logging
import os
from urllib.parse import urlparse
from genson import SchemaBuilder
from .contract_renderer import ContractRenderer
from .strict_schema_builder import StrictSchemaBuilder
LOGGER = logging.getLogger(__name__)
class ContractGenerator:
def __init__(self, ... | true | true |
f726b7dadf4efb4ce13b43f57fed824b080e01f6 | 387 | py | Python | nifty/wsgi.py | waynekyamamoto/jakobia | 04b82f620267f500d7b19937ef2631c6a840c42a | [
"Apache-2.0"
] | null | null | null | nifty/wsgi.py | waynekyamamoto/jakobia | 04b82f620267f500d7b19937ef2631c6a840c42a | [
"Apache-2.0"
] | null | null | null | nifty/wsgi.py | waynekyamamoto/jakobia | 04b82f620267f500d7b19937ef2631c6a840c42a | [
"Apache-2.0"
] | null | null | null | """
WSGI config for nifty 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/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTING... | 22.764706 | 78 | 0.782946 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'nifty.settings')
application = get_wsgi_application()
| true | true |
f726b86af605e3f6febf6ed5b3e113bf41b88604 | 1,158 | py | Python | tests/metrics/test_statsd_metrics.py | bear8421/thumbor | 00a0c44d44b8fa5f06c38deee7123793addda404 | [
"MIT"
] | 1 | 2021-12-24T02:01:52.000Z | 2021-12-24T02:01:52.000Z | tests/metrics/test_statsd_metrics.py | bear8421/thumbor | 00a0c44d44b8fa5f06c38deee7123793addda404 | [
"MIT"
] | 2 | 2022-03-10T22:11:18.000Z | 2022-03-16T22:42:04.000Z | tests/metrics/test_statsd_metrics.py | bear8421/thumbor | 00a0c44d44b8fa5f06c38deee7123793addda404 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com thumbor@googlegroups.com
from preggy import expect
import thumbor.metrics
from tests.base im... | 29.692308 | 79 | 0.707254 |
from preggy import expect
import thumbor.metrics
from tests.base import TestCase
from thumbor.config import Config
from thumbor.context import Context
from thumbor.importer import Importer
class StatsdMetricsTestCase(TestCase):
def get_context(self):
conf = Config()
conf.METRICS = "thum... | true | true |
f726b86fa3b46ca58a327fc2e1c4d7a5610f5095 | 1,055 | py | Python | processing/gray-scale-processing.py | rsampaths16/ReRes | 51089c806c57087eb94d9a659036ebed88e96f13 | [
"Apache-2.0"
] | 2 | 2017-12-19T07:50:25.000Z | 2018-03-26T05:59:54.000Z | processing/gray-scale-processing.py | rsampaths16/ReRes | 51089c806c57087eb94d9a659036ebed88e96f13 | [
"Apache-2.0"
] | null | null | null | processing/gray-scale-processing.py | rsampaths16/ReRes | 51089c806c57087eb94d9a659036ebed88e96f13 | [
"Apache-2.0"
] | 1 | 2020-04-26T03:12:35.000Z | 2020-04-26T03:12:35.000Z | import numpy
import scipy
import glob
from matplotlib import pyplot
from scipy import misc
from numpy import random
random.seed(0)
SIZE = 128
ORIGINAL = '../data/offline-data/black-and-white-images/original'
HIGH = '../data/offline-data/black-and-white-images/train/high'
LOW = '../data/offline-data/black-and-white-ima... | 31.029412 | 65 | 0.649289 | import numpy
import scipy
import glob
from matplotlib import pyplot
from scipy import misc
from numpy import random
random.seed(0)
SIZE = 128
ORIGINAL = '../data/offline-data/black-and-white-images/original'
HIGH = '../data/offline-data/black-and-white-images/train/high'
LOW = '../data/offline-data/black-and-white-ima... | true | true |
f726b8d12a6a6783daf22dfc04e130655b135796 | 5,213 | py | Python | training_3DMatch.py | aosheng1996/D3Feat | d005f3811c12764c16d4f5e9a01c6720e7e72392 | [
"MIT"
] | 1 | 2020-05-11T15:49:34.000Z | 2020-05-11T15:49:34.000Z | training_3DMatch.py | aosheng1996/D3Feat | d005f3811c12764c16d4f5e9a01c6720e7e72392 | [
"MIT"
] | null | null | null | training_3DMatch.py | aosheng1996/D3Feat | d005f3811c12764c16d4f5e9a01c6720e7e72392 | [
"MIT"
] | null | null | null | # Common libs
import time
import os
import sys
# Custom libs
from utils.config import Config
from utils.trainer import ModelTrainer
from models.KPFCNN_model import KernelPointFCNN
# Dataset
from datasets.ThreeDMatch import ThreeDMatchDataset
# ------------------------------------------------------------------------... | 25.0625 | 120 | 0.531939 |
import time
import os
import sys
from utils.config import Config
from utils.trainer import ModelTrainer
from models.KPFCNN_model import KernelPointFCNN
from datasets.ThreeDMatch import ThreeDMatchDataset
class ThreeDMatchConfig(Config):
False
det_loss_weight = 1
offsets_... | true | true |
f726b9d13411d60ad6b93cfd0a6545aa3baa5701 | 367 | py | Python | tests/test_models.py | inmagik/django-rest-admin | 61c0d1a993ebcf144352e0ee0f916d9e63c1ccf7 | [
"BSD-3-Clause"
] | 15 | 2015-11-13T00:22:11.000Z | 2020-02-04T12:07:05.000Z | tests/test_models.py | inmagik/django-rest-admin | 61c0d1a993ebcf144352e0ee0f916d9e63c1ccf7 | [
"BSD-3-Clause"
] | null | null | null | tests/test_models.py | inmagik/django-rest-admin | 61c0d1a993ebcf144352e0ee0f916d9e63c1ccf7 | [
"BSD-3-Clause"
] | 5 | 2015-11-13T11:23:19.000Z | 2019-08-06T18:43:58.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_django-rest-admin
------------
Tests for `django-rest-admin` models module.
"""
from django.test import TestCase
from django_rest_admin import models
class TestDjango_rest_admin(TestCase):
def setUp(self):
pass
def test_something(self):
... | 14.115385 | 44 | 0.640327 |
from django.test import TestCase
from django_rest_admin import models
class TestDjango_rest_admin(TestCase):
def setUp(self):
pass
def test_something(self):
pass
def tearDown(self):
pass
| true | true |
f726b9d6bccaaeb47166b01a9fa17fc6f824bd62 | 3,497 | py | Python | pypureclient/flasharray/FA_2_11/models/maintenance_window_post.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 14 | 2018-12-07T18:30:27.000Z | 2022-02-22T09:12:33.000Z | pypureclient/flasharray/FA_2_11/models/maintenance_window_post.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 28 | 2019-09-17T21:03:52.000Z | 2022-03-29T22:07:35.000Z | pypureclient/flasharray/FA_2_11/models/maintenance_window_post.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 15 | 2020-06-11T15:50:08.000Z | 2022-03-21T09:27:25.000Z | # coding: utf-8
"""
FlashArray REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.11
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
import typing
from ... | 31.223214 | 408 | 0.571061 |
import pprint
import re
import six
import typing
from ....properties import Property
if typing.TYPE_CHECKING:
from pypureclient.flasharray.FA_2_11 import models
class MaintenanceWindowPost(object):
swagger_types = {
'timeout': 'int'
}
attribute_map = {
'timeout': 'timeout'
}
... | true | true |
f726ba59f261a358f8d57550d94c95d42ecd6359 | 1,276 | py | Python | tests/util.py | ecoal95/saltfs | 4d2596794a70919c2887688d6d116f2f5bb5cf1e | [
"Apache-2.0",
"MIT"
] | 1 | 2021-01-07T18:49:38.000Z | 2021-01-07T18:49:38.000Z | tests/util.py | ecoal95/saltfs | 4d2596794a70919c2887688d6d116f2f5bb5cf1e | [
"Apache-2.0",
"MIT"
] | null | null | null | tests/util.py | ecoal95/saltfs | 4d2596794a70919c2887688d6d116f2f5bb5cf1e | [
"Apache-2.0",
"MIT"
] | null | null | null | import os
RED = 31
GREEN = 32
BLUE = 34
MAGENTA = 35
def color(code, string):
return '\033[' + str(code) + 'm' + string + '\033[0m'
def display_path(path):
return color(MAGENTA, path)
def colon():
return color(BLUE, ':')
EXCLUDE_DIRS = ['.git', '.vagrant']
def project_path():
# One dirname fo... | 19.333333 | 67 | 0.630094 | import os
RED = 31
GREEN = 32
BLUE = 34
MAGENTA = 35
def color(code, string):
return '\033[' + str(code) + 'm' + string + '\033[0m'
def display_path(path):
return color(MAGENTA, path)
def colon():
return color(BLUE, ':')
EXCLUDE_DIRS = ['.git', '.vagrant']
def project_path():
project_dir... | true | true |
f726bab48ffce3b6ae7271247b2fa10be660d332 | 488 | py | Python | challenges/insertion/test_insertion.py | glasscharlie/data-structures-and-algorithms | 4546a0606334c6e3156b567d8cc82d39fb183c58 | [
"MIT"
] | null | null | null | challenges/insertion/test_insertion.py | glasscharlie/data-structures-and-algorithms | 4546a0606334c6e3156b567d8cc82d39fb183c58 | [
"MIT"
] | 4 | 2019-12-02T22:28:03.000Z | 2019-12-09T04:17:53.000Z | challenges/insertion/test_insertion.py | glasscharlie/data-structures-and-algorithms | 4546a0606334c6e3156b567d8cc82d39fb183c58 | [
"MIT"
] | null | null | null | from insertion import insertion
def test_unique_values():
lst = [8,4,23,42,16,15]
expected = [4,8,15,16,23,42]
actual = insertion(lst)
assert actual == expected
def test_duplicate_value():
lst = [8,4,23,42,16,15,8,23]
expected = [4,8,8,15,16,23,23,42]
actual = insertion(lst)
assert act... | 24.4 | 37 | 0.631148 | from insertion import insertion
def test_unique_values():
lst = [8,4,23,42,16,15]
expected = [4,8,15,16,23,42]
actual = insertion(lst)
assert actual == expected
def test_duplicate_value():
lst = [8,4,23,42,16,15,8,23]
expected = [4,8,8,15,16,23,23,42]
actual = insertion(lst)
assert act... | true | true |
f726bd9b22797e229793a51530000a11ef85bb1c | 3,516 | py | Python | src/dss/server/dss_logger.py | akraino-edge-stack/ta-distributed-state-server | bd5a0a173f1ae9c64782fbf47565cc26ed23b448 | [
"Apache-2.0"
] | null | null | null | src/dss/server/dss_logger.py | akraino-edge-stack/ta-distributed-state-server | bd5a0a173f1ae9c64782fbf47565cc26ed23b448 | [
"Apache-2.0"
] | null | null | null | src/dss/server/dss_logger.py | akraino-edge-stack/ta-distributed-state-server | bd5a0a173f1ae9c64782fbf47565cc26ed23b448 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Nokia
#
# 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, softwa... | 30.842105 | 106 | 0.614903 |
import sys
import logging
import logging.handlers
from dss.api import dss_error
class Logger:
levels = {'debug': logging.DEBUG,
'info': logging.INFO,
'warning': logging.WARNING,
'error': logging.error}
DEST_CONSOLE = 1
DEST_SYSLOG = 2
dests = {'cons... | true | true |
f726be4df3aac1b1ae5b316e7cceff2b07cb123a | 38 | py | Python | files2md/structure_objects/structurable_directory/__init__.py | KacperKotlewski/file_structure_to_markdown | aad0e1c80f88e0b3d079cf242d43fdc4b7a369f7 | [
"MIT"
] | 1 | 2020-02-22T00:41:04.000Z | 2020-02-22T00:41:04.000Z | files2md/structure_objects/structurable_directory/__init__.py | KacperKotlewski/file_structure_to_markdown | aad0e1c80f88e0b3d079cf242d43fdc4b7a369f7 | [
"MIT"
] | null | null | null | files2md/structure_objects/structurable_directory/__init__.py | KacperKotlewski/file_structure_to_markdown | aad0e1c80f88e0b3d079cf242d43fdc4b7a369f7 | [
"MIT"
] | null | null | null | from .directoryObj import DirectoryObj | 38 | 38 | 0.894737 | from .directoryObj import DirectoryObj | true | true |
f726be65d2d58a2e1ead974e840eb9718283079e | 335 | py | Python | database/table_objects/ping_targets.py | Timo-Meinhof/friedrich-py | 025e45fe23aba0980762af779161626477c567b0 | [
"MIT"
] | 1 | 2021-08-07T12:18:48.000Z | 2021-08-07T12:18:48.000Z | database/table_objects/ping_targets.py | Timo-Meinhof/friedrich-py | 025e45fe23aba0980762af779161626477c567b0 | [
"MIT"
] | null | null | null | database/table_objects/ping_targets.py | Timo-Meinhof/friedrich-py | 025e45fe23aba0980762af779161626477c567b0 | [
"MIT"
] | null | null | null | class User:
def __init__(self, id: str, name: str, color: str, studon: str):
self.id = id
self.name = name
self.color = color
self.studon = studon
class Role:
def __init__(self, id: str, name: str, color: str):
self.id = id
self.name = name
sel... | 27.916667 | 69 | 0.540299 | class User:
def __init__(self, id: str, name: str, color: str, studon: str):
self.id = id
self.name = name
self.color = color
self.studon = studon
class Role:
def __init__(self, id: str, name: str, color: str):
self.id = id
self.name = name
sel... | true | true |
f726bec39c5c25f3abb108a6dd36bed1b16fe8f7 | 12,303 | py | Python | lenstronomy/PointSource/point_source_types.py | franyancr/lenstronomy | 3a7b33512a474bf1796d23276d9028b580580cf1 | [
"MIT"
] | null | null | null | lenstronomy/PointSource/point_source_types.py | franyancr/lenstronomy | 3a7b33512a474bf1796d23276d9028b580580cf1 | [
"MIT"
] | null | null | null | lenstronomy/PointSource/point_source_types.py | franyancr/lenstronomy | 3a7b33512a474bf1796d23276d9028b580580cf1 | [
"MIT"
] | null | null | null | import numpy as np
from lenstronomy.LensModel.Solver.lens_equation_solver import LensEquationSolver
class Unlensed(object):
"""
class of a single point source in the image plane, aka star
parameters: ra_image, dec_image, point_amp
"""
def __init__(self):
pass
def image_position(self,... | 47.137931 | 231 | 0.599366 | import numpy as np
from lenstronomy.LensModel.Solver.lens_equation_solver import LensEquationSolver
class Unlensed(object):
def __init__(self):
pass
def image_position(self, kwargs_ps, kwargs_lens=None, **kwargs):
ra_image = kwargs_ps['ra_image']
dec_image = kwargs_ps['dec_image']
... | true | true |
f726bf47700172a8e614d87926cc30cfdb491818 | 2,508 | py | Python | linkedlist.py | jerrybelmonte/DataStructures-Python | 553a156f685d83291e73e0c35b85167e6b114379 | [
"MIT"
] | null | null | null | linkedlist.py | jerrybelmonte/DataStructures-Python | 553a156f685d83291e73e0c35b85167e6b114379 | [
"MIT"
] | null | null | null | linkedlist.py | jerrybelmonte/DataStructures-Python | 553a156f685d83291e73e0c35b85167e6b114379 | [
"MIT"
] | null | null | null | # LinkedList implementation using a helper Element class
class Element(object):
def __init__(self, value):
self.value = value
self.next = None
class LinkedList(object):
def __init__(self, head=None):
self.head = head
def append(self, new_element):
current = self.head
... | 25.591837 | 56 | 0.555821 |
class Element(object):
def __init__(self, value):
self.value = value
self.next = None
class LinkedList(object):
def __init__(self, head=None):
self.head = head
def append(self, new_element):
current = self.head
if self.head:
while current.next:
... | true | true |
f726c0fcd2d691576e784c9f9ad8d9f54ceb42ec | 4,000 | py | Python | benchmarks/supervectorizer_tuning.py | dirty-cat/categorical-encoding | fb0a1c4216533034e7516efc0698c7e4477b0243 | [
"BSD-3-Clause"
] | 374 | 2018-03-16T09:00:55.000Z | 2022-03-31T14:07:43.000Z | benchmarks/supervectorizer_tuning.py | dirty-cat/categorical-encoding | fb0a1c4216533034e7516efc0698c7e4477b0243 | [
"BSD-3-Clause"
] | 195 | 2018-03-14T13:56:25.000Z | 2022-03-31T11:49:49.000Z | benchmarks/supervectorizer_tuning.py | dirty-cat/categorical-encoding | fb0a1c4216533034e7516efc0698c7e4477b0243 | [
"BSD-3-Clause"
] | 52 | 2018-03-13T13:23:01.000Z | 2022-03-17T09:56:56.000Z | """
Performs a GridSearch to find the best parameters for the SuperVectorizer
among a selection.
"""
import logging
import pandas as pd
from sklearn.ensemble import RandomForestRegressor, RandomForestClassifier
from sklearn.model_selection import GridSearchCV
from sklearn.pipeline import Pipeline
from dirty_cat impo... | 29.850746 | 88 | 0.6265 |
import logging
import pandas as pd
from sklearn.ensemble import RandomForestRegressor, RandomForestClassifier
from sklearn.model_selection import GridSearchCV
from sklearn.pipeline import Pipeline
from dirty_cat import SuperVectorizer
from dirty_cat.datasets import fetch_open_payments, fetch_drug_directory, \
fe... | true | true |
f726c100e03118fe63b2ed7bad2293c84c8e95ee | 282 | py | Python | scripts/batch_stop.py | oretoise/slate | cfbf629417680cd0fe6d745f7d8a50275aef00a9 | [
"MIT"
] | null | null | null | scripts/batch_stop.py | oretoise/slate | cfbf629417680cd0fe6d745f7d8a50275aef00a9 | [
"MIT"
] | null | null | null | scripts/batch_stop.py | oretoise/slate | cfbf629417680cd0fe6d745f7d8a50275aef00a9 | [
"MIT"
] | null | null | null | import pyautogui
pyautogui.PAUSE = 5
while True:
# Click first email in list.
pyautogui.click(640, 345)
# Stop it
pyautogui.click(1760, 430)
pyautogui.click(980, 1020)
pyautogui.typewrite("STOP")
pyautogui.press('enter')
pyautogui.click(580, 220) | 18.8 | 32 | 0.670213 | import pyautogui
pyautogui.PAUSE = 5
while True:
pyautogui.click(640, 345)
pyautogui.click(1760, 430)
pyautogui.click(980, 1020)
pyautogui.typewrite("STOP")
pyautogui.press('enter')
pyautogui.click(580, 220) | true | true |
f726c15fd0c5805fefb311e2ad443ac3c19afea2 | 802 | py | Python | manage.py | guanqingqi/dove | f8681f144e44369bf9e0c9ea76e1994920a14cfb | [
"Apache-2.0"
] | null | null | null | manage.py | guanqingqi/dove | f8681f144e44369bf9e0c9ea76e1994920a14cfb | [
"Apache-2.0"
] | null | null | null | manage.py | guanqingqi/dove | f8681f144e44369bf9e0c9ea76e1994920a14cfb | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dove.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
... | 34.869565 | 77 | 0.640898 |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dove.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
try:
import django
except ImportError:
... | true | true |
f726c16c09d5ab1fb493fbccc82d1e44044c2174 | 11,918 | py | Python | flan/export.py | bretlowery/flan | b79319044fcdb2230ac090232e9056719cb09f17 | [
"MIT"
] | 3 | 2019-08-03T13:27:31.000Z | 2021-06-08T16:25:31.000Z | flan/export.py | bretlowery/flan | b79319044fcdb2230ac090232e9056719cb09f17 | [
"MIT"
] | 2 | 2020-09-24T10:44:55.000Z | 2021-06-25T15:31:24.000Z | flan/export.py | bretlowery/flan | b79319044fcdb2230ac090232e9056719cb09f17 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2012 Splunk, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"): you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 32.38587 | 84 | 0.601275 |
from __future__ import absolute_import
from __future__ import print_function
import sys, os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
import time
from os import path
from splunklib.binding import connect
try:
from utils import parse
except ImportError:
raise E... | true | true |
f726c1f060b031498baf48c9527e53700f69bbf2 | 6,961 | py | Python | virt/ansible-latest/lib/python2.7/site-packages/ansible/modules/network/aos/_aos_device.py | lakhlaifi/RedHat-Ansible | 27c5077cced9d416081fcd5d69ea44bca0317fa4 | [
"Apache-2.0"
] | 1 | 2020-03-29T18:41:01.000Z | 2020-03-29T18:41:01.000Z | ansible/ansible/modules/network/aos/_aos_device.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 7 | 2020-09-07T17:27:56.000Z | 2022-03-02T06:25:46.000Z | ansible/ansible/modules/network/aos/_aos_device.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 1 | 2020-03-22T01:04:48.000Z | 2020-03-22T01:04:48.000Z | #!/usr/bin/python
#
# (c) 2017 Apstra Inc, <community@apstra.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opt... | 31.215247 | 119 | 0.598046 |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['deprecated'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: aos_device
author: Damien Garros (@dgarros)
version_added: "2.3"
short_description: Manage Devices on AOS Server
deprecated:... | true | true |
f726c4efcbe41267a6d7cd4f11809971061e72b5 | 15,902 | py | Python | python/ccxt/async_support/base/exchange.py | halfjuice/ccxt | cc702efbaafba547c3bc973895bd817b3308d072 | [
"MIT"
] | null | null | null | python/ccxt/async_support/base/exchange.py | halfjuice/ccxt | cc702efbaafba547c3bc973895bd817b3308d072 | [
"MIT"
] | null | null | null | python/ccxt/async_support/base/exchange.py | halfjuice/ccxt | cc702efbaafba547c3bc973895bd817b3308d072 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
__version__ = '1.61.55'
# -----------------------------------------------------------------------------
import asyncio
import concurrent.futures
import socket
import certifi
import aiohttp
import ssl
import sys
i... | 43.807163 | 355 | 0.617029 |
__version__ = '1.61.55'
import asyncio
import concurrent.futures
import socket
import certifi
import aiohttp
import ssl
import sys
import yarl
from ccxt.async_support.base.throttler import Throttler
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import ExchangeNotAvailable
from ccxt.base.... | true | true |
f726c5d759f5490c1ae882cd36b4a8678f29a3ed | 4,451 | py | Python | dark/process.py | UdoGi/dark-matter | 3d49e89fa5e81f83144119f6216c5774176d203b | [
"MIT"
] | 10 | 2016-03-09T09:43:14.000Z | 2021-04-03T21:46:12.000Z | dark/process.py | terrycojones/dark-matter | 67d16f870db6b4239e17e542bc6e3f072dc29c75 | [
"MIT"
] | 332 | 2015-01-07T12:37:30.000Z | 2022-01-20T15:48:11.000Z | dark/process.py | terrycojones/dark-matter | 67d16f870db6b4239e17e542bc6e3f072dc29c75 | [
"MIT"
] | 4 | 2016-03-08T14:56:39.000Z | 2021-01-27T08:11:27.000Z | from __future__ import division, print_function
import six
from time import time, ctime
from subprocess import PIPE, CalledProcessError
if six.PY3:
from subprocess import run
else:
from subprocess import check_call
class Executor(object):
"""
Log and execute shell commands.
@param dryRun: If C{... | 38.37069 | 79 | 0.560324 | from __future__ import division, print_function
import six
from time import time, ctime
from subprocess import PIPE, CalledProcessError
if six.PY3:
from subprocess import run
else:
from subprocess import check_call
class Executor(object):
def __init__(self, dryRun=False):
self.dryRun = dryRun
... | true | true |
f726c61ee010e4614285c7fc75b5c47cb8f51c57 | 318 | py | Python | Preprocessing/scripts/dec_user_id.py | udhavsethi/contentNCF | d11273956bf9c793eb616cde9c3da01c70e5403b | [
"Apache-2.0"
] | 2 | 2021-09-16T02:14:57.000Z | 2022-02-02T01:16:26.000Z | Preprocessing/scripts/dec_user_id.py | udhavsethi/contentNCF | d11273956bf9c793eb616cde9c3da01c70e5403b | [
"Apache-2.0"
] | null | null | null | Preprocessing/scripts/dec_user_id.py | udhavsethi/contentNCF | d11273956bf9c793eb616cde9c3da01c70e5403b | [
"Apache-2.0"
] | null | null | null | infile = open('500_users_to_images.train', 'r')
outfile = open('pinterest.data', 'w')
for line in infile.readlines():
user_id, img_id, img_url = line.strip().split('\t')
dec_user_id = str(int(user_id) - 1)
outfile.write("{}\t{}\t{}\n".format(dec_user_id, img_id, img_url))
infile.close()
outfile.close()
| 28.909091 | 70 | 0.666667 | infile = open('500_users_to_images.train', 'r')
outfile = open('pinterest.data', 'w')
for line in infile.readlines():
user_id, img_id, img_url = line.strip().split('\t')
dec_user_id = str(int(user_id) - 1)
outfile.write("{}\t{}\t{}\n".format(dec_user_id, img_id, img_url))
infile.close()
outfile.close()
| true | true |
f726c69eef6c7661033f52ac8cc3885f33c80910 | 686 | py | Python | app/core/migrations/0003_ingredient.py | amaurycoudr/recipe-app-api | ab4da3d5553230d9b15ddc6f97091e3f01cc348e | [
"MIT"
] | null | null | null | app/core/migrations/0003_ingredient.py | amaurycoudr/recipe-app-api | ab4da3d5553230d9b15ddc6f97091e3f01cc348e | [
"MIT"
] | null | null | null | app/core/migrations/0003_ingredient.py | amaurycoudr/recipe-app-api | ab4da3d5553230d9b15ddc6f97091e3f01cc348e | [
"MIT"
] | null | null | null | # Generated by Django 2.1.15 on 2020-08-24 07:56
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0002_tag'),
]
operations = [
migrations.CreateModel(
... | 28.583333 | 118 | 0.618076 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0002_tag'),
]
operations = [
migrations.CreateModel(
name='Ingredient',
fields=[
... | true | true |
f726c7af66c2d6b8cae93c16306362700e6e476b | 2,702 | py | Python | examples/face_recognition_svm.py | viettriit2110/face_recognition | 0e1821af6538c573ed4a87acc361c44900f849eb | [
"MIT"
] | 2 | 2019-11-12T06:22:45.000Z | 2019-11-12T14:30:00.000Z | examples/face_recognition_svm.py | viettriit2110/face_recognition | 0e1821af6538c573ed4a87acc361c44900f849eb | [
"MIT"
] | null | null | null | examples/face_recognition_svm.py | viettriit2110/face_recognition | 0e1821af6538c573ed4a87acc361c44900f849eb | [
"MIT"
] | null | null | null | # Train multiple images per person
# Find and recognize faces in an image using a SVC with scikit-learn
"""
Structure:
<test_image>.jpg
<train_dir>/
<person_1>/
<person_1_face-1>.jpg
<person_1_face-2>.jpg
.
.
... | 33.358025 | 119 | 0.611769 |
import face_recognition
from sklearn import svm
import os
encodings = []
names = []
train_dir = os.listdir('/train_dir/')
for person in train_dir:
pix = os.listdir("/train_dir/" + person)
for person_img in pix:
face = face_recognition.load_image_file("/train_di... | true | true |
f726c7e3f9f0e96210a1b6a0a5aa57076aacdff1 | 17,093 | py | Python | aldryn_newsblog/south_migrations/0010_auto__add_unique_articletranslation_language_code_slug__del_field_arti.py | what-digital/aldryn-newsblog-blog-teaser-size | c52cb256fe3b608838f2184de9575b6cbbfd5f8e | [
"BSD-3-Clause"
] | null | null | null | aldryn_newsblog/south_migrations/0010_auto__add_unique_articletranslation_language_code_slug__del_field_arti.py | what-digital/aldryn-newsblog-blog-teaser-size | c52cb256fe3b608838f2184de9575b6cbbfd5f8e | [
"BSD-3-Clause"
] | null | null | null | aldryn_newsblog/south_migrations/0010_auto__add_unique_articletranslation_language_code_slug__del_field_arti.py | what-digital/aldryn-newsblog-blog-teaser-size | c52cb256fe3b608838f2184de9575b6cbbfd5f8e | [
"BSD-3-Clause"
] | 2 | 2019-10-22T04:30:28.000Z | 2019-10-22T05:09:16.000Z | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from aldryn_newsblog.utils.migration import rename_tables_old_to_new, rename_tables_new_to_old
class Migration(SchemaMigration):
def forwards(self,... | 83.789216 | 195 | 0.572398 |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from aldryn_newsblog.utils.migration import rename_tables_old_to_new, rename_tables_new_to_old
class Migration(SchemaMigration):
def forwards(self, orm):
rename_t... | true | true |
f726c922dcd0dfb1fe6fe59bdb40b901325c9e0a | 33,645 | py | Python | ambassador/ambassador/config/resourcefetcher.py | Andrei-Predoiu/ambassador | efbd0ac8d65e36eab68997051167bc3eea165f35 | [
"Apache-2.0"
] | null | null | null | ambassador/ambassador/config/resourcefetcher.py | Andrei-Predoiu/ambassador | efbd0ac8d65e36eab68997051167bc3eea165f35 | [
"Apache-2.0"
] | null | null | null | ambassador/ambassador/config/resourcefetcher.py | Andrei-Predoiu/ambassador | efbd0ac8d65e36eab68997051167bc3eea165f35 | [
"Apache-2.0"
] | null | null | null | from typing import Any, Dict, List, Optional, Tuple, TYPE_CHECKING
# from typing import cast as typecast
import json
import logging
import os
import yaml
from .config import Config
from .acresource import ACResource
from ..utils import parse_yaml, dump_yaml
AnyDict = Dict[str, Any]
HandlerResult = Optional[Tuple[st... | 41.332924 | 286 | 0.575895 | from typing import Any, Dict, List, Optional, Tuple, TYPE_CHECKING
import json
import logging
import os
import yaml
from .config import Config
from .acresource import ACResource
from ..utils import parse_yaml, dump_yaml
AnyDict = Dict[str, Any]
HandlerResult = Optional[Tuple[str, List[AnyDict]]]
# resources,... | true | true |
f726c946b28663f6039c3f5e99cf5aef3b6ee900 | 302 | py | Python | pyexcel/sheets/__init__.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 1 | 2022-01-25T22:52:58.000Z | 2022-01-25T22:52:58.000Z | pyexcel/sheets/__init__.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | pyexcel/sheets/__init__.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | """
pyexcel.sheets
~~~~~~~~~~~~~~~~~~~
Core functionality of pyexcel, data model
:copyright: (c) 2014-2017 by Onni Software Ltd.
:license: New BSD License, see LICENSE for more details
"""
# flake8: noqa
from .sheet import Sheet
from .matrix import Matrix, transpose, Row, Column
| 23.230769 | 59 | 0.652318 |
from .sheet import Sheet
from .matrix import Matrix, transpose, Row, Column
| true | true |
f726caa23a352acc6478111d0682e07e79f4858c | 860 | py | Python | route/main_file.py | LiteHell/openNAMU | 72bd1ec1d4b63bd74876bf1c4bb3c4002ec9fdd1 | [
"BSD-3-Clause"
] | null | null | null | route/main_file.py | LiteHell/openNAMU | 72bd1ec1d4b63bd74876bf1c4bb3c4002ec9fdd1 | [
"BSD-3-Clause"
] | null | null | null | route/main_file.py | LiteHell/openNAMU | 72bd1ec1d4b63bd74876bf1c4bb3c4002ec9fdd1 | [
"BSD-3-Clause"
] | null | null | null | from .tool.func import *
from . import main_error_404
def main_file_2(conn, data):
curs = conn.cursor()
if data == 'easter_egg.html':
return easy_minify(flask.render_template(skin_check(),
imp = ['easter_egg.html', wiki_set(), custom(), other2([0, 0])],
data = open('./views/mai... | 40.952381 | 109 | 0.603488 | from .tool.func import *
from . import main_error_404
def main_file_2(conn, data):
curs = conn.cursor()
if data == 'easter_egg.html':
return easy_minify(flask.render_template(skin_check(),
imp = ['easter_egg.html', wiki_set(), custom(), other2([0, 0])],
data = open('./views/mai... | true | true |
f726cb978618b466b6e7a32b01c4590b62b5c7a6 | 3,077 | py | Python | commons/__init__.py | oeg-upm/ttla | ab1cc5a2777b3d4fb905f4452379f469153c904b | [
"Apache-2.0"
] | null | null | null | commons/__init__.py | oeg-upm/ttla | ab1cc5a2777b3d4fb905f4452379f469153c904b | [
"Apache-2.0"
] | 5 | 2019-04-03T12:58:29.000Z | 2021-06-02T00:18:34.000Z | commons/__init__.py | oeg-upm/bob | ab1cc5a2777b3d4fb905f4452379f469153c904b | [
"Apache-2.0"
] | null | null | null | import os
import pandas as pd
from easysparql import *
ENDPOINT = "https://dbpedia.org/sparql"
MIN_NUM_OF_ENT_PER_PROP = 30 # the minimum number of entities per property (get_properties)
QUERY_LIMIT = "" # At the moment, we do not put any limit on the number of results
MIN_NUM_NUMS = 30 # The minimum number of valu... | 26.756522 | 102 | 0.646409 | import os
import pandas as pd
from easysparql import *
ENDPOINT = "https://dbpedia.org/sparql"
MIN_NUM_OF_ENT_PER_PROP = 30
QUERY_LIMIT = ""
MIN_NUM_NUMS = 30
proj_path = (os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir))
data_dir = os.path.join(proj_path, 'data')
meta_dir = os.path.join(pr... | true | true |
f726cc74ea48e6d84a1083f2a64bd4568a8f55c4 | 8,841 | py | Python | tools/pkg/tmpl.py | kristoffer-paulsson/angelos | 2ec236770d6530884a8ad88505aab01183f752b4 | [
"MIT"
] | 8 | 2020-06-07T23:26:34.000Z | 2022-03-28T00:20:34.000Z | tools/pkg/tmpl.py | kristoffer-paulsson/angelos | 2ec236770d6530884a8ad88505aab01183f752b4 | [
"MIT"
] | 1 | 2019-12-24T22:06:02.000Z | 2020-07-12T19:18:57.000Z | tools/pkg/tmpl.py | kristoffer-paulsson/angelos | 2ec236770d6530884a8ad88505aab01183f752b4 | [
"MIT"
] | null | null | null | #
# Copyright (c) 2018-2020 by Kristoffer Paulsson <kristoffer.paulsson@talenten.se>.
#
# This software is available under the terms of the MIT license. Parts are licensed under
# different terms if stated. The legal terms are attached to the LICENSE file and are
# made available on:
#
# https://opensource.org/lice... | 26.54955 | 121 | 0.679222 |
import datetime
import os
import re
import shutil
from pathlib import Path
from .data import NAME_NIX, VERSION, LICENSE, URL, PERMS_DIR, PERMS_EXEC, PERMS_FILE, EXEC_PREFIX, DIR_ANGELOS, \
FILE_ENV, FILE_CONF, FILE_EXE, USERNAME, GROUPNAME, NAME_SERVICE, DIR_VAR, DIR_LOG, DIR_ETC, FILE_ADMINS, LINK_E... | true | true |
f726cc8a8a3084e57b5bf0e9e1bfcc87faa21241 | 6,494 | py | Python | dvc/stage/serialize.py | asford/dvc | 4ed55d00511ea3d9115b76c463e1a466408b11ef | [
"Apache-2.0"
] | 1 | 2021-06-18T19:36:13.000Z | 2021-06-18T19:36:13.000Z | dvc/stage/serialize.py | asford/dvc | 4ed55d00511ea3d9115b76c463e1a466408b11ef | [
"Apache-2.0"
] | 82 | 2021-05-04T02:40:05.000Z | 2022-03-31T03:14:04.000Z | dvc/stage/serialize.py | asford/dvc | 4ed55d00511ea3d9115b76c463e1a466408b11ef | [
"Apache-2.0"
] | 2 | 2021-06-14T19:12:25.000Z | 2021-06-14T19:12:29.000Z | from collections import OrderedDict
from functools import partial
from operator import attrgetter
from typing import TYPE_CHECKING, List, no_type_check
from funcy import post_processing
from dvc.dependency import ParamsDependency
from dvc.output import BaseOutput
from dvc.utils.collections import apply_diff
from dvc.... | 31.221154 | 79 | 0.665075 | from collections import OrderedDict
from functools import partial
from operator import attrgetter
from typing import TYPE_CHECKING, List, no_type_check
from funcy import post_processing
from dvc.dependency import ParamsDependency
from dvc.output import BaseOutput
from dvc.utils.collections import apply_diff
from dvc.... | true | true |
f726cca87b9b1703027d92c330e14876f773484c | 8,401 | py | Python | mmdet/models/losses/my_cross_entropy_loss.py | dyabel/wsod-mmdet | 60fc1993ea298f992b160b5599a6134702ac0d4f | [
"Apache-2.0"
] | 6 | 2021-10-09T05:34:04.000Z | 2022-03-31T00:36:55.000Z | mmdet/models/losses/my_cross_entropy_loss.py | dyabel/wsod-mmdet | 60fc1993ea298f992b160b5599a6134702ac0d4f | [
"Apache-2.0"
] | null | null | null | mmdet/models/losses/my_cross_entropy_loss.py | dyabel/wsod-mmdet | 60fc1993ea298f992b160b5599a6134702ac0d4f | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from ..builder import LOSSES
from .utils import weight_reduce_loss
eps = 0.000001
def cross_entropy_without_softmax(pred,
label,
weight=None,
... | 36.055794 | 79 | 0.59612 | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from ..builder import LOSSES
from .utils import weight_reduce_loss
eps = 0.000001
def cross_entropy_without_softmax(pred,
label,
weight=None,
... | true | true |
f726ce223abc85e16691c9ec990fbe29a1aa1ef0 | 400 | py | Python | sys_monitor/wsgi.py | PeterXUYAOHAI/System_Monitor | 2b78107a7f87e13ebab38ea5a89c870ef5415fd2 | [
"MIT"
] | 2 | 2018-05-07T03:30:55.000Z | 2018-05-10T11:27:18.000Z | sys_monitor/wsgi.py | PeterXUYAOHAI/System_Monitor | 2b78107a7f87e13ebab38ea5a89c870ef5415fd2 | [
"MIT"
] | null | null | null | sys_monitor/wsgi.py | PeterXUYAOHAI/System_Monitor | 2b78107a7f87e13ebab38ea5a89c870ef5415fd2 | [
"MIT"
] | null | null | null | """
WSGI config for sys_monitor 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/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_... | 23.529412 | 78 | 0.79 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sys_monitor.settings")
application = get_wsgi_application()
| true | true |
f726cee2a25f6da66c15f0d51afb12dd8579d0fe | 6,439 | py | Python | python/oneflow/nn/optimizer/sgd.py | grybd/oneflow | 82237ad096a10527591660c09b61444c42917e69 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | python/oneflow/nn/optimizer/sgd.py | grybd/oneflow | 82237ad096a10527591660c09b61444c42917e69 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | python/oneflow/nn/optimizer/sgd.py | grybd/oneflow | 82237ad096a10527591660c09b61444c42917e69 | [
"Apache-2.0"
] | 520 | 2020-07-31T05:52:42.000Z | 2022-03-29T02:38:11.000Z | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 33.362694 | 131 | 0.55226 | import collections
from typing import Callable, Dict, Iterator, List, Union
import oneflow as flow
from oneflow.nn.parameter import Parameter
from .optimizer import Optimizer, ParamGroup
class SGD(Optimizer):
def __init__(
self,
parameters: Union[Iterator[Parameter], List[Dict]],
lr: fl... | true | true |
f726cff10848dfee859add52644fda3f040aa102 | 966 | py | Python | nms/benchmark/nms_numba_cpu.py | ForrestPi/ObjectDetection | 54e0821e73f67be5360c36f01229a123c34ab3b3 | [
"MIT"
] | 12 | 2020-03-25T01:24:22.000Z | 2021-09-18T06:40:16.000Z | nms/benchmark/nms_numba_cpu.py | ForrestPi/ObjectDetection | 54e0821e73f67be5360c36f01229a123c34ab3b3 | [
"MIT"
] | 1 | 2020-04-22T07:52:36.000Z | 2020-04-22T07:52:36.000Z | nms/benchmark/nms_numba_cpu.py | ForrestPi/ObjectDetection | 54e0821e73f67be5360c36f01229a123c34ab3b3 | [
"MIT"
] | 4 | 2020-03-25T01:24:26.000Z | 2020-09-20T11:29:09.000Z | from __future__ import absolute_import
import numba
import numpy as np
@numba.jit(nopython=True)
def nms_cpu(dets, thresh):
x1 = dets[:, 0]
y1 = dets[:, 1]
x2 = dets[:, 2]
y2 = dets[:, 3]
scores = dets[:, 4]
areas = (x2 - x1 + 1) * (y2 - y1 + 1)
order = scores.argsort()[::-1]
keep = []
... | 25.421053 | 59 | 0.519669 | from __future__ import absolute_import
import numba
import numpy as np
@numba.jit(nopython=True)
def nms_cpu(dets, thresh):
x1 = dets[:, 0]
y1 = dets[:, 1]
x2 = dets[:, 2]
y2 = dets[:, 3]
scores = dets[:, 4]
areas = (x2 - x1 + 1) * (y2 - y1 + 1)
order = scores.argsort()[::-1]
keep = []
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.