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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c32bcec0553e370ac4baffa77df6bcc9051b48b | 397 | py | Python | tests/test_binomial.py | fau-klue/pandas-association-measures | 80625936d8c25afc81810a5c82b2b7fff66a375c | [
"MIT"
] | 5 | 2020-07-30T08:17:53.000Z | 2021-12-09T09:00:03.000Z | tests/test_binomial.py | fau-klue/pandas-association-measures | 80625936d8c25afc81810a5c82b2b7fff66a375c | [
"MIT"
] | 11 | 2019-04-14T21:28:25.000Z | 2021-12-07T10:35:49.000Z | tests/test_binomial.py | fau-klue/pandas-association-measures | 80625936d8c25afc81810a5c82b2b7fff66a375c | [
"MIT"
] | null | null | null | import pytest
from association_measures import binomial as bi
@pytest.mark.binomial
def test_choose():
assert bi.choose(9, 3) == 84
assert bi.choose(5, 2) == 10
assert bi.choose(2, 2) == 1
assert bi.choose(0, 0) == 1
assert bi.choose(-3, 5) == 0
assert bi.choose(-2, -2) == 0
assert bi.ch... | 23.352941 | 58 | 0.629723 | import pytest
from association_measures import binomial as bi
@pytest.mark.binomial
def test_choose():
assert bi.choose(9, 3) == 84
assert bi.choose(5, 2) == 10
assert bi.choose(2, 2) == 1
assert bi.choose(0, 0) == 1
assert bi.choose(-3, 5) == 0
assert bi.choose(-2, -2) == 0
assert bi.ch... | true | true |
1c32be0998b0394d9fa7382a2b7e68a4e0aa3b72 | 2,962 | py | Python | src/ktop/widget_dashboard.py | deathbeds/ktop | b9ff55af75980526337ea1903bda83ccf1bf2f1e | [
"BSD-3-Clause"
] | null | null | null | src/ktop/widget_dashboard.py | deathbeds/ktop | b9ff55af75980526337ea1903bda83ccf1bf2f1e | [
"BSD-3-Clause"
] | 1 | 2018-01-19T17:11:40.000Z | 2018-01-19T17:11:40.000Z | src/ktop/widget_dashboard.py | deathbeds/ktop | b9ff55af75980526337ea1903bda83ccf1bf2f1e | [
"BSD-3-Clause"
] | null | null | null | import traitlets as T
import ipywidgets as W
class DefaultKernelView(W.VBox):
""" Show a kernel
"""
def __init__(self, *args, **kwargs):
kernel = kwargs.pop("kernel")
super(DefaultKernelView, self).__init__(*args, **kwargs)
progress = W.FloatProgress(min=0.0, max=1.0)
wid... | 27.425926 | 73 | 0.497974 | import traitlets as T
import ipywidgets as W
class DefaultKernelView(W.VBox):
def __init__(self, *args, **kwargs):
kernel = kwargs.pop("kernel")
super(DefaultKernelView, self).__init__(*args, **kwargs)
progress = W.FloatProgress(min=0.0, max=1.0)
widgets = W.VBox()
shutdo... | true | true |
1c32bef877f7c9cf27ab6520cf26b17fc8852996 | 5,118 | py | Python | zodiac_circle_v2.2.py | DCRHallum/Zodiac-Circle | 9a121f982bd2a813e4fa8aee725b7949703f2564 | [
"CC0-1.0"
] | null | null | null | zodiac_circle_v2.2.py | DCRHallum/Zodiac-Circle | 9a121f982bd2a813e4fa8aee725b7949703f2564 | [
"CC0-1.0"
] | null | null | null | zodiac_circle_v2.2.py | DCRHallum/Zodiac-Circle | 9a121f982bd2a813e4fa8aee725b7949703f2564 | [
"CC0-1.0"
] | null | null | null | zodiac_signs = ['aries','taurus','gemini','cancer','leo','virgo','libra','scorpio','sagittarius','capricorn','aquarius','pisces']
fin_zodiac_signs = ['Aries','Taurus','Gemini','Cancer','Leo','Virgo','Libra','Scorpio','Sagittarius','Capricorn','Aquarius','Pisces']
houses = ['Mars','Venus','Mercury','The Moon','The Sun... | 33.45098 | 175 | 0.655334 | zodiac_signs = ['aries','taurus','gemini','cancer','leo','virgo','libra','scorpio','sagittarius','capricorn','aquarius','pisces']
fin_zodiac_signs = ['Aries','Taurus','Gemini','Cancer','Leo','Virgo','Libra','Scorpio','Sagittarius','Capricorn','Aquarius','Pisces']
houses = ['Mars','Venus','Mercury','The Moon','The Sun... | true | true |
1c32c03775f8c3d36f64ba55ad12508fc9bcf5e2 | 4,699 | py | Python | createaddr.py | xcbtrader/multi-btc-address-create | 7904b30dfe9457cd669bd113e28fb74ec1be3350 | [
"MIT"
] | null | null | null | createaddr.py | xcbtrader/multi-btc-address-create | 7904b30dfe9457cd669bd113e28fb74ec1be3350 | [
"MIT"
] | null | null | null | createaddr.py | xcbtrader/multi-btc-address-create | 7904b30dfe9457cd669bd113e28fb74ec1be3350 | [
"MIT"
] | null | null | null | __author__ = 'deunido'
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from bitcoin import *
from tkinter import *
from tkinter import ttk, font
import sys
import requests
import json
class Aplicacion():
def __init__(self):
self.raiz = Tk()
self.raiz.geometry("700x305")
self.raiz.resizable(width=F... | 34.807407 | 216 | 0.662269 | __author__ = 'deunido'
from bitcoin import *
from tkinter import *
from tkinter import ttk, font
import sys
import requests
import json
class Aplicacion():
def __init__(self):
self.raiz = Tk()
self.raiz.geometry("700x305")
self.raiz.resizable(width=False, height=False)
self.raiz.title("Multi C... | true | true |
1c32c2c431f709326d664e14c7f2c6b0b119b490 | 1,031 | py | Python | detect_mask_and_ocr.py | isomorphicdude/Highlighted-Text-OCR | 07557bf77172b5e411f83352d8c4a6ba1b46fe6a | [
"MIT"
] | null | null | null | detect_mask_and_ocr.py | isomorphicdude/Highlighted-Text-OCR | 07557bf77172b5e411f83352d8c4a6ba1b46fe6a | [
"MIT"
] | null | null | null | detect_mask_and_ocr.py | isomorphicdude/Highlighted-Text-OCR | 07557bf77172b5e411f83352d8c4a6ba1b46fe6a | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import torch
import easyocr
# Reading the image
img = cv2.imread('image.jpg')
#define kernel size
kernel = np.ones((7,7),np.uint8)
# convert to hsv colorspace
hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
# lower bound and upper bound for Green color
# lower_bound =... | 25.146341 | 55 | 0.694471 | import cv2
import numpy as np
import torch
import easyocr
img = cv2.imread('image.jpg')
kernel = np.ones((7,7),np.uint8)
hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
lower_bound = np.array([20, 80, 80])
upper_bound = np.array([30, 255, 255])
mask = cv2.inRange(hsv, lower_bound, upper_bound)
... | true | true |
1c32c3186b313f3e843531f74356fcc5f1147f9b | 45,071 | py | Python | pkgs/conf-pkg/src/genie/libs/conf/l2vpn/iosxr/bridge_domain.py | miott/genielibs | 6464642cdd67aa2367bdbb12561af4bb060e5e62 | [
"Apache-2.0"
] | 94 | 2018-04-30T20:29:15.000Z | 2022-03-29T13:40:31.000Z | pkgs/conf-pkg/src/genie/libs/conf/l2vpn/iosxr/bridge_domain.py | miott/genielibs | 6464642cdd67aa2367bdbb12561af4bb060e5e62 | [
"Apache-2.0"
] | 67 | 2018-12-06T21:08:09.000Z | 2022-03-29T18:00:46.000Z | pkgs/conf-pkg/src/genie/libs/conf/l2vpn/iosxr/bridge_domain.py | miott/genielibs | 6464642cdd67aa2367bdbb12561af4bb060e5e62 | [
"Apache-2.0"
] | 49 | 2018-06-29T18:59:03.000Z | 2022-03-10T02:07:59.000Z |
from abc import ABC
import warnings
import contextlib
from genie.conf.base.attributes import UnsupportedAttributeWarning,\
AttributesHelper
from genie.conf.base.cli import CliConfigBuilder
from genie.conf.base.config import CliConfig
from genie.libs.conf.interface import BviInterface
from genie.libs.conf.l2vpn.p... | 85.039623 | 191 | 0.609305 |
from abc import ABC
import warnings
import contextlib
from genie.conf.base.attributes import UnsupportedAttributeWarning,\
AttributesHelper
from genie.conf.base.cli import CliConfigBuilder
from genie.conf.base.config import CliConfig
from genie.libs.conf.interface import BviInterface
from genie.libs.conf.l2vpn.p... | true | true |
1c32c430911cda1f536110a33edb83aad3b2f3d6 | 64,678 | py | Python | python/pyspark/pandas/internal.py | amwufiv/spark | b50d4507f52315d5f6d75c617e845248a1c828a9 | [
"BSD-2-Clause",
"Apache-2.0",
"CC0-1.0",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 7 | 2015-02-05T10:57:54.000Z | 2022-01-12T08:52:54.000Z | python/pyspark/pandas/internal.py | amwufiv/spark | b50d4507f52315d5f6d75c617e845248a1c828a9 | [
"BSD-2-Clause",
"Apache-2.0",
"CC0-1.0",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 27 | 2021-04-14T16:44:15.000Z | 2022-03-13T00:35:17.000Z | python/pyspark/pandas/internal.py | amwufiv/spark | b50d4507f52315d5f6d75c617e845248a1c828a9 | [
"BSD-2-Clause",
"Apache-2.0",
"CC0-1.0",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 6 | 2022-01-24T20:07:59.000Z | 2022-01-25T16:11:34.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... | 40.172671 | 106 | 0.581434 |
import re
from typing import Any, Dict, List, Optional, Sequence, Tuple, Union, TYPE_CHECKING, cast
import numpy as np
import pandas as pd
from pandas.api.types import CategoricalDtype from pyspark._globals import _NoValue, _NoValueType
from pyspark.sql import functions as F, Column, DataFrame as SparkDataFrame, Win... | true | true |
1c32c4bd87d48b8ecbc4afc1533f653fe99d2f0f | 3,387 | py | Python | exot/util/analysers.py | ETHZ-TEC/exot_eengine | 7b7ce6cb949e1b0a02e716b03f2f9af751713b29 | [
"BSD-3-Clause"
] | null | null | null | exot/util/analysers.py | ETHZ-TEC/exot_eengine | 7b7ce6cb949e1b0a02e716b03f2f9af751713b29 | [
"BSD-3-Clause"
] | null | null | null | exot/util/analysers.py | ETHZ-TEC/exot_eengine | 7b7ce6cb949e1b0a02e716b03f2f9af751713b29 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2015-2020, Swiss Federal Institute of Technology (ETH Zurich)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright... | 40.807229 | 92 | 0.679658 | import numpy as np
import pandas as pd
from exot.util.attributedict import LabelMapping
def all_labels_in_dataset(experiment, sort_str=False, **kwargs):
for key in ["phase", "labelcolumn", "io"]:
if key not in kwargs.keys():
raise ValueError(f"key {key} not specified in kwargs!")
ingest_a... | true | true |
1c32c5bf3ef61e16be2fe366d916eb5e61b98c5c | 7,985 | py | Python | docs/conf.py | tony/sphinx-argparse | dcf53c8092e87e375388f8691a28254fbbd7ac24 | [
"MIT"
] | null | null | null | docs/conf.py | tony/sphinx-argparse | dcf53c8092e87e375388f8691a28254fbbd7ac24 | [
"MIT"
] | null | null | null | docs/conf.py | tony/sphinx-argparse | dcf53c8092e87e375388f8691a28254fbbd7ac24 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# sphinx-argparse documentation build configuration file, created by
# sphinx-quickstart on Thu Jan 31 15:13:43 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.... | 32.45935 | 100 | 0.717721 |
import sys, os
sys.path.insert(0, os.path.abspath('..'))
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.viewcode']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'sphinx-argparse'
copyright = u'2013, Alex Rudakov'
# |version| ... | true | true |
1c32c6c2808bf6c3550db9b366434945d7d62c09 | 3,371 | py | Python | kin.py | yuri-almeid/Snackin-Assistant | 750aa6c0b29a810ee5d3fb85a24ccc5a384e25b0 | [
"Apache-2.0"
] | 1 | 2021-06-12T13:43:39.000Z | 2021-06-12T13:43:39.000Z | kin.py | yuri-almeid/Snackin-Assistant | 750aa6c0b29a810ee5d3fb85a24ccc5a384e25b0 | [
"Apache-2.0"
] | null | null | null | kin.py | yuri-almeid/Snackin-Assistant | 750aa6c0b29a810ee5d3fb85a24ccc5a384e25b0 | [
"Apache-2.0"
] | null | null | null |
## Importando Módulos
from ibm_watson import TextToSpeechV1 # Biblioteca IBM Watson para TTS
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator # Biblioteca IBM Watson para autenticação da API
from datetime import datetime # módulo de tempo
from datetime import date # Módulo de tempo (data)
import random
i... | 29.831858 | 113 | 0.613171 |
from ibm_watson import TextToSpeechV1 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator from datetime import datetime from datetime import date import random
import os
def IBM_auth():
print(" >>> Iniciando autenticação do IBM Watson...")
print()
apikey = 'wu9NYkYxx6jzVQrvrdRK3rCQk5et-VDTSpApn... | true | true |
1c32c6ccaac73c2b146765c6a92a1e99e7b49e0f | 4,484 | py | Python | windcraft/text.py | marchdf/windcraft | 9334864171f10c7a2fa1f0da71938551cc45465a | [
"Apache-2.0"
] | null | null | null | windcraft/text.py | marchdf/windcraft | 9334864171f10c7a2fa1f0da71938551cc45465a | [
"Apache-2.0"
] | 2 | 2018-03-12T23:41:26.000Z | 2018-03-16T16:19:28.000Z | windcraft/text.py | marchdf/windcraft | 9334864171f10c7a2fa1f0da71938551cc45465a | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 National Renewable Energy Laboratory. This software
# is released under the license detailed in the file, LICENSE, which
# is located in the top-level directory structure.
# ========================================================================
#
# Imports
#
# =======================================... | 41.906542 | 86 | 0.48595 |
import pygame
import windcraft.colors as colors
import windcraft.fonts as fonts
class Text():
def __init__(self):
self.colors = colors.Colors()
self.fonts = fonts.Fonts()
self.yoffset = 0.03 * pygame.display.get_surface().get_height()
def display(self, screen, num_turbines, max_turb... | true | true |
1c32c6ed3176ab052d74abbd5c969a01cd06cee4 | 10,605 | py | Python | test/test_provider_notification_subscriptions_api.py | vericred/vericred-python | be45691c821a595c3d77a561b2ca33049b1239b4 | [
"Apache-2.0"
] | 3 | 2016-08-10T23:39:11.000Z | 2021-08-25T02:39:39.000Z | test/test_provider_notification_subscriptions_api.py | vericred/vericred-python | be45691c821a595c3d77a561b2ca33049b1239b4 | [
"Apache-2.0"
] | 2 | 2016-05-27T12:44:08.000Z | 2016-08-24T18:19:36.000Z | test/test_provider_notification_subscriptions_api.py | vericred/vericred-python | be45691c821a595c3d77a561b2ca33049b1239b4 | [
"Apache-2.0"
] | 4 | 2016-05-27T08:18:14.000Z | 2021-08-25T02:41:18.000Z | # coding: utf-8
"""
Vericred API
Vericred's API allows you to search for Health Plans that a specific doctor
accepts.
## Getting Started
Visit our [Developer Portal](https://developers.vericred.com) to
create an account.
Once you have created an account, you can create one Application for
Production and an... | 39.570896 | 228 | 0.671759 |
from __future__ import absolute_import
import os
import sys
import unittest
import vericred_client
from vericred_client.rest import ApiException
from vericred_client.apis.provider_notification_subscriptions_api import ProviderNotificationSubscriptionsApi
class TestProviderNotificationSubscriptionsApi(unittest.Tes... | true | true |
1c32c7f89a9fed5d1178980ccfdbc998795f0171 | 1,592 | py | Python | lib/surface/ml_engine/jobs/describe.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | null | null | null | lib/surface/ml_engine/jobs/describe.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | null | null | null | lib/surface/ml_engine/jobs/describe.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | 1 | 2020-07-24T20:13:29.000Z | 2020-07-24T20:13:29.000Z | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 33.87234 | 74 | 0.759422 |
from googlecloudsdk.api_lib.ml_engine import jobs
from googlecloudsdk.calliope import base
from googlecloudsdk.command_lib.ml_engine import flags
from googlecloudsdk.command_lib.ml_engine import jobs_util
from googlecloudsdk.core import log
def _AddDescribeArgs(parser):
flags.JOB_NAME.AddToParser(parser)
flags.G... | true | true |
1c32c88929975fdde3db41aa931defc525144752 | 4,526 | py | Python | phyutil/phyapp/common/tornado/auth/crowd.py | frib-high-level-controls/phyhlc | 6486607e3aa0212054a12e9f2ad1a3ef15542f48 | [
"BSD-3-Clause"
] | 1 | 2018-03-22T15:18:54.000Z | 2018-03-22T15:18:54.000Z | phyutil/phyapp/common/tornado/auth/crowd.py | frib-high-level-controls/phyhlc | 6486607e3aa0212054a12e9f2ad1a3ef15542f48 | [
"BSD-3-Clause"
] | null | null | null | phyutil/phyapp/common/tornado/auth/crowd.py | frib-high-level-controls/phyhlc | 6486607e3aa0212054a12e9f2ad1a3ef15542f48 | [
"BSD-3-Clause"
] | null | null | null | # encoding: UTF-8
#
# Copyright (c) 2015, Facility for Rare Isotope Beams
#
#
"""
Implements authentication support using the Atlassian Crowd service RESTful API.
.. moduleauthor:: Dylan Maxwell <maxwelld@frib.msu.edu>
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import ... | 32.561151 | 88 | 0.659744 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import time
import logging
from tornado.gen import coroutine
from tornado.gen import Return
from tornado.httputil import HTTPHeaders
from tornado.httpclient import HTTPError
from tornado.httpclient import HT... | true | true |
1c32c8e2b728f4959affb9559606f07c687dac76 | 1,656 | py | Python | cyrax/events.py | piranha/cyrax | fd1c0473f0c69631339b2a5476933b00f604c643 | [
"0BSD"
] | 10 | 2015-12-18T22:39:02.000Z | 2021-03-03T15:11:05.000Z | cyrax/events.py | piranha/cyrax | fd1c0473f0c69631339b2a5476933b00f604c643 | [
"0BSD"
] | 9 | 2016-01-01T09:28:13.000Z | 2019-12-17T09:39:15.000Z | cyrax/events.py | piranha/cyrax | fd1c0473f0c69631339b2a5476933b00f604c643 | [
"0BSD"
] | 9 | 2015-12-31T23:18:07.000Z | 2020-08-10T10:56:46.000Z | # -*- coding: utf-8 -*-
"""
cyrax.events
~~~~~~~~~~~~~~~
:copyright: 2007-2008 by Armin Ronacher as glashammer.utils.events
:copyright: 2009 by Alexander Solovyov
:license: MIT
"""
import logging
from collections import deque
try:
from sys import intern
except ImportError:
pass
logger ... | 25.476923 | 79 | 0.610507 |
import logging
from collections import deque
try:
from sys import intern
except ImportError:
pass
logger = logging.getLogger(__name__)
class EventManager(object):
def __init__(self):
self._listeners = {}
self._last_listener = 0
def connect(self, event, callback, prepend=False):
... | true | true |
1c32c949f32cd734de31efaf4aa3e2b1f1b83a1c | 5,754 | py | Python | qlib/data/base.py | minkefusiji/qlib | 5ee2d9496b2ffb261b2ec077b1aac88298938040 | [
"MIT"
] | 2 | 2021-11-09T05:12:36.000Z | 2021-11-09T05:12:40.000Z | qlib/data/base.py | GuBuChang/qlib | 7b15682c637106d4da0801e942d889c5615ebb70 | [
"MIT"
] | null | null | null | qlib/data/base.py | GuBuChang/qlib | 7b15682c637106d4da0801e942d889c5615ebb70 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from __future__ import division
from __future__ import print_function
import abc
import pandas as pd
from ..log import get_module_logger
class Expression(abc.ABC):
"""Expression base class"""
def __str__(self):
return type(s... | 24.381356 | 100 | 0.607404 |
from __future__ import division
from __future__ import print_function
import abc
import pandas as pd
from ..log import get_module_logger
class Expression(abc.ABC):
def __str__(self):
return type(self).__name__
def __repr__(self):
return str(self)
def __gt__(self, other):
fro... | true | true |
1c32c97738a15cff439f8342b36199b82ae5409a | 3,902 | py | Python | kmip/tests/unit/core/test_policy.py | vbnmmnbv/PyKMIP | 4617ae528006178c466fe3945a477f568b596940 | [
"Apache-2.0"
] | 12 | 2016-09-14T21:59:10.000Z | 2020-03-11T07:37:25.000Z | kmip/tests/unit/core/test_policy.py | vbnmmnbv/PyKMIP | 4617ae528006178c466fe3945a477f568b596940 | [
"Apache-2.0"
] | null | null | null | kmip/tests/unit/core/test_policy.py | vbnmmnbv/PyKMIP | 4617ae528006178c466fe3945a477f568b596940 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2016 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... | 29.78626 | 76 | 0.59021 |
import shutil
import tempfile
import testtools
from kmip.core import enums
from kmip.core import policy
class TestPolicy(testtools.TestCase):
def setUp(self):
super(TestPolicy, self).setUp()
self.temp_dir = tempfile.mkdtemp()
self.addCleanup(shutil.rmtree, self.temp_dir)
def tearD... | true | true |
1c32ca2f342192aa11548e66287cc2d2ff6b0c83 | 10,104 | py | Python | pyHeatTransfer/conduction.py | OSUmageed/pyHeatTransfer | b1db8ca7594a657826a1ccfb38a4e4eb102cce55 | [
"MIT"
] | 3 | 2017-07-30T19:01:21.000Z | 2021-06-03T23:28:16.000Z | pyHeatTransfer/conduction.py | OSUmageed/pyHeatTransfer | b1db8ca7594a657826a1ccfb38a4e4eb102cce55 | [
"MIT"
] | null | null | null | pyHeatTransfer/conduction.py | OSUmageed/pyHeatTransfer | b1db8ca7594a657826a1ccfb38a4e4eb102cce55 | [
"MIT"
] | 1 | 2020-06-28T08:28:59.000Z | 2020-06-28T08:28:59.000Z | #I suppose the idea is that it gets these values from somewhere and takes off.
#Regardless of where those values come from.
import os
import os.path as op
import sys
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import CoolProp.CoolProp as cp
import collections
import time
imp... | 29.630499 | 140 | 0.538104 |
import os
import os.path as op
import sys
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import CoolProp.CoolProp as cp
import collections
import time
import random
from deco import concurrent, synchronized
sourcepath = op.abspath(op.dirname(__file__))
gitpath = op.dirname(s... | true | true |
1c32ca3aa49e20ae7571a8f8bceee4c37493a328 | 6,188 | py | Python | model/DynamicPricing.py | pranavsb/RL_smart_grid | b23b407d3c873171d9a2af6d5a0104a7bcadc6cd | [
"MIT"
] | 8 | 2019-09-06T08:05:23.000Z | 2022-03-24T23:40:55.000Z | model/DynamicPricing.py | pranavsb/RL_smart_grid | b23b407d3c873171d9a2af6d5a0104a7bcadc6cd | [
"MIT"
] | 1 | 2020-10-30T13:00:49.000Z | 2021-01-28T04:18:34.000Z | model/DynamicPricing.py | pranavsb/RL_smart_grid | b23b407d3c873171d9a2af6d5a0104a7bcadc6cd | [
"MIT"
] | 3 | 2020-09-12T16:21:44.000Z | 2020-11-05T20:33:34.000Z | from Environment import Environment
from QTableAgent import QTableAgent
import time, os
import numpy as np
import pickle
from Utils import get_battery_reward_factor
SOURCE_DEMAND_STATE = 'demand'
SOURCE_SMART_LOADS = True
SOURCE_LEARNING_RATE = 0.03
SOURCE_DISCOUNT_FACTOR = 0.95
SOURCE_NUM_LOADS = 10
SOURCE_MODE = 'va... | 40.444444 | 173 | 0.627182 | from Environment import Environment
from QTableAgent import QTableAgent
import time, os
import numpy as np
import pickle
from Utils import get_battery_reward_factor
SOURCE_DEMAND_STATE = 'demand'
SOURCE_SMART_LOADS = True
SOURCE_LEARNING_RATE = 0.03
SOURCE_DISCOUNT_FACTOR = 0.95
SOURCE_NUM_LOADS = 10
SOURCE_MODE = 'va... | true | true |
1c32cb7103a6a39e5bcb355a0f36e5866914d3b6 | 298,432 | py | Python | src/oci/os_management/os_management_client.py | ezequielramos/oci-python-sdk | cc4235cf217beaf9feed75760e9ce82610222762 | [
"Apache-2.0",
"BSD-3-Clause"
] | 3 | 2020-09-10T22:09:45.000Z | 2021-12-24T17:00:07.000Z | src/oci/os_management/os_management_client.py | ezequielramos/oci-python-sdk | cc4235cf217beaf9feed75760e9ce82610222762 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/os_management/os_management_client.py | ezequielramos/oci-python-sdk | cc4235cf217beaf9feed75760e9ce82610222762 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 48.336897 | 262 | 0.647632 |
from __future__ import absolute_import
from oci._vendor import requests from oci._vendor import six
from oci import retry, circuit_breaker from oci.base_client import BaseClient
from oci.config import get_config_value_or_default, validate_config
from oci.signer import Signer
from oci.util import Sentinel, get_sign... | true | true |
1c32cbf02d8a965ded2df7baac755640a4f074e0 | 2,501 | py | Python | kornia/contrib/max_blur_pool.py | IEM-Computer-Vision/kornia | f98bd9a2158a6e59cda076d55d476acf13f4e0af | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | kornia/contrib/max_blur_pool.py | IEM-Computer-Vision/kornia | f98bd9a2158a6e59cda076d55d476acf13f4e0af | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | kornia/contrib/max_blur_pool.py | IEM-Computer-Vision/kornia | f98bd9a2158a6e59cda076d55d476acf13f4e0af | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | from typing import Tuple
import torch
import torch.nn as nn
import torch.nn.functional as F
from kornia.geometry.transform.pyramid import pyrdown
__all__ = [
"max_blur_pool2d",
"MaxBlurPool2d",
]
def _compute_zero_padding(kernel_size: Tuple[int, int]) -> Tuple[int, int]:
"""Computes zero padding tuple.... | 31.658228 | 100 | 0.62615 | from typing import Tuple
import torch
import torch.nn as nn
import torch.nn.functional as F
from kornia.geometry.transform.pyramid import pyrdown
__all__ = [
"max_blur_pool2d",
"MaxBlurPool2d",
]
def _compute_zero_padding(kernel_size: Tuple[int, int]) -> Tuple[int, int]:
padding = [(k - 1) // 2 for k i... | true | true |
1c32cc54145a5ead761dc49d1c6ae9962191bca9 | 502 | py | Python | python/tuples.py | Shaimyst/toy-problems | 3ed20f7cba90504f0711f58c387d30db23be858b | [
"MIT"
] | null | null | null | python/tuples.py | Shaimyst/toy-problems | 3ed20f7cba90504f0711f58c387d30db23be858b | [
"MIT"
] | null | null | null | python/tuples.py | Shaimyst/toy-problems | 3ed20f7cba90504f0711f58c387d30db23be858b | [
"MIT"
] | null | null | null | # Task
# Given an integer, 'n', and 'n' space-separated integers as input, create a tuple, 't',
# of those integers. Then compute and print the result of hash(t).
# Sample Input 0
# 2
# 1 2
# Sample Output 0
# 3713081631934410656
if __name__ == '__main__':
n = int(raw_input())
integer_list = map(int, raw_i... | 22.818182 | 88 | 0.661355 |
if __name__ == '__main__':
n = int(raw_input())
integer_list = map(int, raw_input().split())
my_tuple = tuple(integer_list)
print(hash(my_tuple)) | true | true |
1c32cdf46dce0ec761ecdb963bbacea91f05c4a1 | 1,395 | py | Python | python-opcua/timetable_parser.py | ssriblo/ionic-smarthome-test-1 | 060bc247e0b8295d6cd869d90b364756515cfc19 | [
"MIT"
] | 1 | 2020-12-18T15:18:19.000Z | 2020-12-18T15:18:19.000Z | python-opcua/timetable_parser.py | ssriblo/ionic-smarthome-test-1 | 060bc247e0b8295d6cd869d90b364756515cfc19 | [
"MIT"
] | 42 | 2020-08-20T04:01:12.000Z | 2021-01-09T18:50:21.000Z | python-opcua/timetable_parser.py | ssriblo/ionic-smarthome-test-1 | 060bc247e0b8295d6cd869d90b364756515cfc19 | [
"MIT"
] | null | null | null | import numpy as np
import sys
import json
class DataParserTT(object):
def __init__(self):
pass
# Let convert from string to json:
#
def timetableParser(self, str):
# ob = self.obj
a = [None]*16
print(f"\n\nstr type", type(str), str) # магическим образом э... | 31 | 123 | 0.424373 | import numpy as np
import sys
import json
class DataParserTT(object):
def __init__(self):
pass
def timetableParser(self, str):
a = [None]*16
print(f"\n\nstr type", type(str), str) ob = json.loads(str)
try:
if (ob['mode'] == "TimeTable"):
... | true | true |
1c32cebad503494afaeb02a6817eeb5b18bd9cd8 | 12,464 | py | Python | src/gluonts/model/deepvar_hierarchical/_network.py | Xiaoxiong-Liu/gluon-ts | 097c492769258dd70b7f223f826b17b0051ceee9 | [
"Apache-2.0"
] | 2,648 | 2019-06-03T17:18:27.000Z | 2022-03-31T08:29:22.000Z | src/gluonts/model/deepvar_hierarchical/_network.py | Xiaoxiong-Liu/gluon-ts | 097c492769258dd70b7f223f826b17b0051ceee9 | [
"Apache-2.0"
] | 1,220 | 2019-06-04T09:00:14.000Z | 2022-03-31T10:45:43.000Z | src/gluonts/model/deepvar_hierarchical/_network.py | Xiaoxiong-Liu/gluon-ts | 097c492769258dd70b7f223f826b17b0051ceee9 | [
"Apache-2.0"
] | 595 | 2019-06-04T01:04:31.000Z | 2022-03-30T10:40:26.000Z | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... | 33.326203 | 120 | 0.634467 |
from typing import List, Optional
from itertools import product
import mxnet as mx
import numpy as np
from gluonts.core.component import validated
from gluonts.mx import Tensor
from gluonts.mx.distribution import Distribution, DistributionOutput
from gluonts.mx.distribution import EmpiricalDistribution
from gluonts.... | true | true |
1c32ced5986b513b59820c9d7855cb384387ef16 | 6,208 | py | Python | simpleai/search/models.py | kod3r/simpleai | 989f7ae3e1d770b34aa41611243635fd6109aff8 | [
"MIT"
] | 1 | 2019-04-19T23:05:28.000Z | 2019-04-19T23:05:28.000Z | simpleai/search/models.py | kod3r/simpleai | 989f7ae3e1d770b34aa41611243635fd6109aff8 | [
"MIT"
] | null | null | null | simpleai/search/models.py | kod3r/simpleai | 989f7ae3e1d770b34aa41611243635fd6109aff8 | [
"MIT"
] | null | null | null | # coding=utf-8
class SearchProblem(object):
'''Abstract base class to represent and manipulate the search space of a
problem.
In this class, the search space is meant to be represented implicitly as
a graph.
Each state corresponds with a problem state (ie, a valid configuration)
... | 35.073446 | 79 | 0.598099 |
class SearchProblem(object):
def __init__(self, initial_state):
self.initial_state = initial_state
def actions(self, state):
raise NotImplementedError
def result(self, state, action):
raise NotImplementedError
def cost(self, state, action, state2):
return 1
def... | true | true |
1c32cf13fb47d925ee945cb67723304bbf17b044 | 2,298 | py | Python | tp_screening/tests/test_subject_screeing_form.py | MoffatMore/tp-screening | 20a98ba6fc57118968e507bdf5861cbdcada1848 | [
"MIT"
] | null | null | null | tp_screening/tests/test_subject_screeing_form.py | MoffatMore/tp-screening | 20a98ba6fc57118968e507bdf5861cbdcada1848 | [
"MIT"
] | null | null | null | tp_screening/tests/test_subject_screeing_form.py | MoffatMore/tp-screening | 20a98ba6fc57118968e507bdf5861cbdcada1848 | [
"MIT"
] | null | null | null | '''
Created on Jun 22, 2018
@author: moffat
'''
from django.test import TestCase, tag
from edc_constants.constants import YES, FEMALE, NO, NOT_APPLICABLE
from ..forms import SubjectScreeningForm
from edc_base.utils import get_utcnow
from copy import copy
@tag('TestSubjectForm')
class TestSubjectScreeningForm(TestCa... | 31.916667 | 67 | 0.622715 |
from django.test import TestCase, tag
from edc_constants.constants import YES, FEMALE, NO, NOT_APPLICABLE
from ..forms import SubjectScreeningForm
from edc_base.utils import get_utcnow
from copy import copy
@tag('TestSubjectForm')
class TestSubjectScreeningForm(TestCase):
def setUp(self):
self.screening... | true | true |
1c32d0dbb302a6369ad6d5b15600eda528f552aa | 38,427 | py | Python | atlassian/bamboo.py | ezchi/atlassian-python-api | 721a4895348fc410b4781f2c1af01b6ddf80b9c5 | [
"Apache-2.0"
] | null | null | null | atlassian/bamboo.py | ezchi/atlassian-python-api | 721a4895348fc410b4781f2c1af01b6ddf80b9c5 | [
"Apache-2.0"
] | null | null | null | atlassian/bamboo.py | ezchi/atlassian-python-api | 721a4895348fc410b4781f2c1af01b6ddf80b9c5 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
import logging
from requests.exceptions import HTTPError
from .rest_client import AtlassianRestAPI
log = logging.getLogger(__name__)
class Bamboo(AtlassianRestAPI):
"""Private methods"""
def _get_generator(
self,
path,
elements_key="results",
element_key="res... | 35.449262 | 120 | 0.601608 | import logging
from requests.exceptions import HTTPError
from .rest_client import AtlassianRestAPI
log = logging.getLogger(__name__)
class Bamboo(AtlassianRestAPI):
def _get_generator(
self,
path,
elements_key="results",
element_key="result",
data=None,
flags=No... | true | true |
1c32d4d28c537a81e998d99b7abbb9c41bd7fce6 | 13,439 | py | Python | pdkb/test/aamas.py | QuMuLab/PDKB-Planning | 61a96c006b606aa051b2c7c9b5bfc9b6473d2a4d | [
"MIT"
] | 11 | 2020-05-11T15:32:49.000Z | 2021-09-14T17:49:48.000Z | pdkb/test/aamas.py | QuMuLab/PDKB-Planning | 61a96c006b606aa051b2c7c9b5bfc9b6473d2a4d | [
"MIT"
] | 1 | 2020-04-22T13:16:49.000Z | 2020-04-22T13:16:49.000Z | pdkb/test/aamas.py | QuMuLab/PDKB-Planning | 61a96c006b606aa051b2c7c9b5bfc9b6473d2a4d | [
"MIT"
] | 4 | 2020-04-16T08:51:17.000Z | 2021-09-14T17:51:50.000Z |
import sys, random, time
from pdkb.kd45 import *
from pdkb.indexed_kd45 import *
from pdkb.pinf import *
from pdkb.rml import *
from pdkb.test.utils import random_pdkb, random_rml, write_file, append_file
TYPE = 'normal'
NUM_PDKBS = 10
QUERIES_PER_PDKB = 10
if 'small' == TYPE:
AGENTS = (2,3)
DEPTH = (2,3)
... | 36.22372 | 193 | 0.564328 |
import sys, random, time
from pdkb.kd45 import *
from pdkb.indexed_kd45 import *
from pdkb.pinf import *
from pdkb.rml import *
from pdkb.test.utils import random_pdkb, random_rml, write_file, append_file
TYPE = 'normal'
NUM_PDKBS = 10
QUERIES_PER_PDKB = 10
if 'small' == TYPE:
AGENTS = (2,3)
DEPTH = (2,3)
... | true | true |
1c32d51cb8737141a11db3eef28fed93d17034df | 20,597 | py | Python | ixnetwork_restpy/testplatform/sessions/ixnetwork/quicktest/rfc3918ipmcminmaxlat_26e8ac413e1c57bed7d65373af19d55d.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 20 | 2019-05-07T01:59:14.000Z | 2022-02-11T05:24:47.000Z | ixnetwork_restpy/testplatform/sessions/ixnetwork/quicktest/rfc3918ipmcminmaxlat_26e8ac413e1c57bed7d65373af19d55d.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 60 | 2019-04-03T18:59:35.000Z | 2022-02-22T12:05:05.000Z | ixnetwork_restpy/testplatform/sessions/ixnetwork/quicktest/rfc3918ipmcminmaxlat_26e8ac413e1c57bed7d65373af19d55d.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 13 | 2019-05-20T10:48:31.000Z | 2021-10-06T07:45:44.000Z | # MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify,... | 43.362105 | 193 | 0.646793 | from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
from typing import List, Any, Union
class Rfc3918ipmcMinMaxLat(Base):
__slots__ = ()
_SDM_NAME = 'rfc3918ipmcMinMaxLat'
_SDM_ATT_MAP = {
'ForceApplyQTConfig': 'forceApplyQTConfig',
'InputParameters': 'inputPar... | true | true |
1c32d61fcb9418e9dcc63acc39db3553e81a2963 | 12,641 | py | Python | models/main.py | PKUxxz/simp-detr | c83846b1b6fc0e396e268dcfef278e162cf231c5 | [
"Apache-2.0"
] | null | null | null | models/main.py | PKUxxz/simp-detr | c83846b1b6fc0e396e268dcfef278e162cf231c5 | [
"Apache-2.0"
] | null | null | null | models/main.py | PKUxxz/simp-detr | c83846b1b6fc0e396e268dcfef278e162cf231c5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import argparse
import datetime
import json
import random
import sys
import time
from pathlib import Path
import numpy as np
import torch
from torch.utils.data import DataLoader, DistributedSampler
sys.path.append("../../../lib")
import datasets
i... | 46.304029 | 119 | 0.624159 | import argparse
import datetime
import json
import random
import sys
import time
from pathlib import Path
import numpy as np
import torch
from torch.utils.data import DataLoader, DistributedSampler
sys.path.append("../../../lib")
import datasets
import util.misc as utils
from datasets import build_dataset, get_coco_a... | true | true |
1c32d66bea5628ee2e303da88010cebf2114cd34 | 5,646 | py | Python | tests/test_rdscluster.py | agiza/cloud-custodian | 9592d0f700970e05e89574280cfe0e1479c95228 | [
"Apache-2.0"
] | null | null | null | tests/test_rdscluster.py | agiza/cloud-custodian | 9592d0f700970e05e89574280cfe0e1479c95228 | [
"Apache-2.0"
] | null | null | null | tests/test_rdscluster.py | agiza/cloud-custodian | 9592d0f700970e05e89574280cfe0e1479c95228 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 38.148649 | 90 | 0.591038 | from common import BaseTest
from c7n.executor import MainThreadExecutor
from c7n.resources import rdscluster
class RDSClusterTest(BaseTest):
def test_rdscluster_simple(self):
session_factory = self.replay_flight_data('test_rdscluster_simple')
p = self.load_policy({
'name': 'rdscluste... | true | true |
1c32d68f3c087086e1183822232971de969a5f6a | 1,359 | py | Python | _bin/java2smali.py | HongxuChen/dotfiles | 4a51a74ae3345273514faccf40a47e1a39048049 | [
"MIT"
] | 13 | 2015-09-11T14:53:06.000Z | 2021-12-19T23:07:06.000Z | _bin/java2smali.py | HongxuChen/dotfiles | 4a51a74ae3345273514faccf40a47e1a39048049 | [
"MIT"
] | 5 | 2015-03-18T17:08:01.000Z | 2020-01-07T08:51:47.000Z | _bin/java2smali.py | HongxuChen/dotfiles | 4a51a74ae3345273514faccf40a47e1a39048049 | [
"MIT"
] | 4 | 2016-12-27T14:52:19.000Z | 2019-05-16T07:07:53.000Z | #!/usr/bin/env python3
from __future__ import print_function
import os
import shutil
import subprocess
version = "1.6"
name = "_java2smali"
dex_type = "apk"
def require(cond, msg):
if not cond:
raise Exception(msg)
def run(cmd):
print("=> {}".format(cmd))
subprocess.call(cmd.split())
def ... | 21.234375 | 74 | 0.629139 |
from __future__ import print_function
import os
import shutil
import subprocess
version = "1.6"
name = "_java2smali"
dex_type = "apk"
def require(cond, msg):
if not cond:
raise Exception(msg)
def run(cmd):
print("=> {}".format(cmd))
subprocess.call(cmd.split())
def java2jar(d):
java_f... | true | true |
1c32d71d45f237e8444736f93738b7e89ba16125 | 1,225 | py | Python | setup.py | dreamkeep/hbp-neuromorphic-client | e4268321e12d6bb0da600ed977d088317b7c47d9 | [
"Apache-2.0"
] | 1 | 2019-12-24T04:29:11.000Z | 2019-12-24T04:29:11.000Z | setup.py | dreamkeep/hbp-neuromorphic-client | e4268321e12d6bb0da600ed977d088317b7c47d9 | [
"Apache-2.0"
] | null | null | null | setup.py | dreamkeep/hbp-neuromorphic-client | e4268321e12d6bb0da600ed977d088317b7c47d9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from distutils.core import setup
long_description = open("README.md").read()
setup(
name="hbp_neuromorphic_platform",
version='0.7.2',
packages=['nmpi'],
install_requires=['requests',],
author="Andrew P. Davison and Domenico Guarino",
author_email... | 36.029412 | 94 | 0.638367 |
from distutils.core import setup
long_description = open("README.md").read()
setup(
name="hbp_neuromorphic_platform",
version='0.7.2',
packages=['nmpi'],
install_requires=['requests',],
author="Andrew P. Davison and Domenico Guarino",
author_email="andrew.davison@unic.cnrs-gif.fr",
descri... | true | true |
1c32d7a8998db158d1459d6bbf46c622488c673c | 1,185 | py | Python | setup.py | woolfson-group/array_sensing | ae9e0c7d9137e4034d183ebc920b7ee6352ebc93 | [
"MIT"
] | null | null | null | setup.py | woolfson-group/array_sensing | ae9e0c7d9137e4034d183ebc920b7ee6352ebc93 | [
"MIT"
] | null | null | null | setup.py | woolfson-group/array_sensing | ae9e0c7d9137e4034d183ebc920b7ee6352ebc93 | [
"MIT"
] | null | null | null |
from setuptools import setup, find_packages
with open('README.md', 'r') as f:
long_description = f.read()
setup(
name='array_sensing',
packages=find_packages(),
version='0.1.0',
description=('BADASS_ML: A package to parse the input data and run ML '
'on fluorescence data collecte... | 40.862069 | 79 | 0.611814 |
from setuptools import setup, find_packages
with open('README.md', 'r') as f:
long_description = f.read()
setup(
name='array_sensing',
packages=find_packages(),
version='0.1.0',
description=('BADASS_ML: A package to parse the input data and run ML '
'on fluorescence data collecte... | true | true |
1c32d7f72ce35c184dd89232c5ca0cace531ab3f | 1,034 | py | Python | efilter_tests/unit/protocols/applicative.py | Onager/dotty | b145131499be0c4b755fc2e2ac19be11a50bce6a | [
"Apache-2.0"
] | 54 | 2015-08-02T14:26:50.000Z | 2021-10-21T02:44:25.000Z | efilter_tests/unit/protocols/applicative.py | Onager/dotty | b145131499be0c4b755fc2e2ac19be11a50bce6a | [
"Apache-2.0"
] | 23 | 2015-11-27T10:08:58.000Z | 2017-09-27T08:54:56.000Z | efilter_tests/unit/protocols/applicative.py | Onager/dotty | b145131499be0c4b755fc2e2ac19be11a50bce6a | [
"Apache-2.0"
] | 16 | 2015-08-14T10:11:20.000Z | 2021-10-21T02:44:18.000Z | # EFILTER Forensic Query Language
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... | 27.945946 | 74 | 0.752418 |
__author__ = "Adam Sindelar <adamsh@google.com>"
import unittest
from efilter_tests import mocks
from efilter.protocols import applicative
class ApplicativeTest(unittest.TestCase):
def testApplyingFunction(self):
result = applicative.apply(mocks.MockFunction(), [10], dict(y=20))
self.assert... | true | true |
1c32d80c636c7007f06dbb384a20862f86d2b290 | 8,945 | py | Python | tests/test_segmentation.py | goitom/eemeter | bb05d5b776546858f8f3a8d3a95bec202728d9f0 | [
"Apache-2.0"
] | null | null | null | tests/test_segmentation.py | goitom/eemeter | bb05d5b776546858f8f3a8d3a95bec202728d9f0 | [
"Apache-2.0"
] | null | null | null | tests/test_segmentation.py | goitom/eemeter | bb05d5b776546858f8f3a8d3a95bec202728d9f0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright 2018 Open Energy Efficiency, 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/LICE... | 32.060932 | 85 | 0.651202 | import json
import numpy as np
import pandas as pd
import pytest
from eemeter.segmentation import (
CalTRACKSegmentModel,
SegmentedModel,
segment_time_series,
iterate_segmented_dataset,
)
@pytest.fixture
def index_8760():
return pd.date_range("2017-01-01", periods=365 * 24, freq="H", tz="UTC")
... | true | true |
1c32d8431f0489ef556ac058fc71283341a5757d | 64 | py | Python | setup.py | ken2403/schnettriple | 28df9c89648f07524b563c0b9b58d93d9264869c | [
"MIT"
] | null | null | null | setup.py | ken2403/schnettriple | 28df9c89648f07524b563c0b9b58d93d9264869c | [
"MIT"
] | null | null | null | setup.py | ken2403/schnettriple | 28df9c89648f07524b563c0b9b58d93d9264869c | [
"MIT"
] | null | null | null | import setuptools
# argumet is in setup.cfg
setuptools.setup()
| 12.8 | 25 | 0.78125 | import setuptools
setuptools.setup()
| true | true |
1c32d8bc34e95480e3ea1a50f32460e724aa0965 | 36,950 | py | Python | src/models/model.py | CrafterKolyan/IRNet-1 | 72df5c876f368ae4a1b594e7a740ff966dbbd3ba | [
"MIT"
] | 223 | 2019-11-11T09:06:51.000Z | 2022-03-17T06:55:56.000Z | src/models/model.py | KevinQian97/Semantic-Error-Correction | 0cbad02e4a6c8638af12c14856df84d143f9299d | [
"Apache-2.0"
] | 50 | 2019-11-17T08:08:09.000Z | 2022-02-13T08:54:02.000Z | src/models/model.py | KevinQian97/Semantic-Error-Correction | 0cbad02e4a6c8638af12c14856df84d143f9299d | [
"Apache-2.0"
] | 86 | 2019-11-11T09:07:50.000Z | 2022-02-14T07:41:33.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
# -*- coding: utf-8 -*-
"""
# @Time : 2019/5/25
# @Author : Jiaqi&Zecheng
# @File : model.py
# @Software: PyCharm
"""
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.utils... | 48.300654 | 140 | 0.532476 |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.utils
from torch.autograd import Variable
from src.beam import Beams, ActionInfo
from src.dataset import Batch
from src.models import nn_utils
from src.models.basic_model import BasicModel
from src.models... | true | true |
1c32dbb26c5581a55894974e838f48581581ce9e | 20,395 | py | Python | cnns/foolbox/foolbox_2_3_0/attacks/hop_skip_jump_attack.py | anonymous-user-commits/perturb-net | 66fc7c4a1234fa34b92bcc85751f0a6e23d80a23 | [
"MIT"
] | 12 | 2021-07-27T07:18:24.000Z | 2022-03-09T13:52:20.000Z | cnns/foolbox/foolbox_2_3_0/attacks/hop_skip_jump_attack.py | anonymous-user-commits/perturb-net | 66fc7c4a1234fa34b92bcc85751f0a6e23d80a23 | [
"MIT"
] | 2 | 2021-08-03T09:21:33.000Z | 2021-12-29T14:25:30.000Z | cnns/foolbox/foolbox_2_3_0/attacks/hop_skip_jump_attack.py | anonymous-user-commits/perturb-net | 66fc7c4a1234fa34b92bcc85751f0a6e23d80a23 | [
"MIT"
] | 3 | 2021-11-18T14:46:40.000Z | 2022-01-03T15:47:23.000Z | import warnings
import time
import sys
from .base import Attack
from .base import generator_decorator
from ..distances import MSE, Linf
from ..criteria import Misclassification
import numpy as np
import math
from warnings import warn
import logging
class HopSkipJumpAttack(Attack):
"""A powerful adversarial attac... | 37.559853 | 102 | 0.54783 | import warnings
import time
import sys
from .base import Attack
from .base import generator_decorator
from ..distances import MSE, Linf
from ..criteria import Misclassification
import numpy as np
import math
from warnings import warn
import logging
class HopSkipJumpAttack(Attack):
@generator_decorator
def a... | true | true |
1c32dd699853256f1e8ca3c43d488c9561e77f45 | 374 | py | Python | Exe13_Dias_da_semana.py | lucaslk122/Exercicios_Python_estutura_decisao | 51a9699c5d85aa6cfb163d891c56e804a7255634 | [
"MIT"
] | null | null | null | Exe13_Dias_da_semana.py | lucaslk122/Exercicios_Python_estutura_decisao | 51a9699c5d85aa6cfb163d891c56e804a7255634 | [
"MIT"
] | null | null | null | Exe13_Dias_da_semana.py | lucaslk122/Exercicios_Python_estutura_decisao | 51a9699c5d85aa6cfb163d891c56e804a7255634 | [
"MIT"
] | null | null | null | print("Digite um numero inteiro, de 1 a 7 que retornarei qual dia da semana é")
dia = int(input())
if dia == 1:
print("Domingo")
elif dia == 2:
print("Segunda")
elif dia == 3:
print("Terça")
elif dia == 4:
print("Quarta")
elif dia == 5:
print("Quinta")
elif dia == 6:
print("Sexta")
elif dia == ... | 20.777778 | 79 | 0.593583 | print("Digite um numero inteiro, de 1 a 7 que retornarei qual dia da semana é")
dia = int(input())
if dia == 1:
print("Domingo")
elif dia == 2:
print("Segunda")
elif dia == 3:
print("Terça")
elif dia == 4:
print("Quarta")
elif dia == 5:
print("Quinta")
elif dia == 6:
print("Sexta")
elif dia == ... | true | true |
1c32dd85b8535f53247c6abf36aeeb797e6fcb1c | 10,005 | py | Python | mealpy/bio_based/VCS.py | Alhassan20/mealpy | 7ed365c5c495ad1c1e066662c90159b3d5e9b8e3 | [
"MIT"
] | 162 | 2020-08-31T10:13:06.000Z | 2022-03-31T09:38:19.000Z | mealpy/bio_based/VCS.py | Alhassan20/mealpy | 7ed365c5c495ad1c1e066662c90159b3d5e9b8e3 | [
"MIT"
] | 51 | 2020-09-13T10:46:31.000Z | 2022-03-30T06:12:08.000Z | mealpy/bio_based/VCS.py | Alhassan20/mealpy | 7ed365c5c495ad1c1e066662c90159b3d5e9b8e3 | [
"MIT"
] | 58 | 2020-09-12T13:29:18.000Z | 2022-03-31T09:38:21.000Z | #!/usr/bin/env python
# ------------------------------------------------------------------------------------------------------%
# Created by "Thieu Nguyen" at 22:07, 11/04/2020 %
# ... | 51.572165 | 148 | 0.53963 |
from numpy import sum, log1p, array, mean, prod, abs, where
from numpy.random import uniform, normal, choice
from copy import deepcopy
from mealpy.optimizer import Root
class BaseVCS(Root):
def __init__(self, obj_func=None, lb=None, ub=None, verbose=True, epoch=750, pop_size=100, lamda=0.5, xichma=0.3, **kwargs... | true | true |
1c32de006462a0aee12320703b3287e24affe290 | 2,477 | py | Python | sdk/python/pulumi_azure_nextgen/kusto/v20190121/list_database_principals.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/kusto/v20190121/list_database_principals.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/kusto/v20190121/list_database_principals.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... | 35.898551 | 152 | 0.69237 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
__all__ = [
'ListDatabasePrincipalsResult',
'AwaitableListDatabasePrincipalsResult',
'list_database_principals',
]
@pulumi.output_type
c... | true | true |
1c32de7addcb2901a9b6caafd9376cc644a4b77e | 3,229 | py | Python | PythonBaseDemo/GraphicInterfaceProgrammin/11.8/manipulate_tag.py | CypHelp/TestNewWorldDemo | ee6f73df05756f191c1c56250fa290461fdd1b9a | [
"Apache-2.0"
] | null | null | null | PythonBaseDemo/GraphicInterfaceProgrammin/11.8/manipulate_tag.py | CypHelp/TestNewWorldDemo | ee6f73df05756f191c1c56250fa290461fdd1b9a | [
"Apache-2.0"
] | null | null | null | PythonBaseDemo/GraphicInterfaceProgrammin/11.8/manipulate_tag.py | CypHelp/TestNewWorldDemo | ee6f73df05756f191c1c56250fa290461fdd1b9a | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#########################################################################
# 网站: <a href="http://www.crazyit.org">疯狂Java联盟</a> #
# author yeeku.H.lee kongyeeku@163.com #
# #
# version 1.0 ... | 42.486842 | 85 | 0.453081 | from tkinter import *
root = Tk()
root.title('操作标签')
cv = Canvas(root, background='white', width=620, height=250)
cv.pack(fill=BOTH, expand=YES)
rt = cv.create_rectangle(40, 40, 300, 220,
outline='blue', width=2,
tag = ('t1', 't2', 't3', 'tag4')) print(rt) oval = cv.create_oval(350, 50, 580, 200,
fill='ye... | true | true |
1c32deff61557b7a2ba4518c3ad36f40f29a3a21 | 964 | py | Python | kubernetes/test/test_v1_replica_set_list.py | Scalr/kubernetes-client-python | 07442bdb76f0876ec96c0b0da6f9c4b06d7e5e38 | [
"Apache-2.0"
] | 3 | 2019-05-19T05:05:37.000Z | 2020-03-20T04:56:20.000Z | kubernetes/test/test_v1_replica_set_list.py | Scalr/kubernetes-client-python | 07442bdb76f0876ec96c0b0da6f9c4b06d7e5e38 | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_v1_replica_set_list.py | Scalr/kubernetes-client-python | 07442bdb76f0876ec96c0b0da6f9c4b06d7e5e38 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.13.5
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
i... | 21.422222 | 105 | 0.709544 |
from __future__ import absolute_import
import os
import sys
import unittest
import kubernetes.client
from kubernetes.client.rest import ApiException
from kubernetes.client.models.v1_replica_set_list import V1ReplicaSetList
class TestV1ReplicaSetList(unittest.TestCase):
def setUp(self):
pass
def... | true | true |
1c32dfb7d010be6550570f6a03b005a2b2b34c94 | 536 | py | Python | apidocs/search_es.py | kleag/external-knowledge-codegen | 9b6562a549d4bad755fa99a3bee15521fac59e97 | [
"Apache-2.0"
] | null | null | null | apidocs/search_es.py | kleag/external-knowledge-codegen | 9b6562a549d4bad755fa99a3bee15521fac59e97 | [
"Apache-2.0"
] | null | null | null | apidocs/search_es.py | kleag/external-knowledge-codegen | 9b6562a549d4bad755fa99a3bee15521fac59e97 | [
"Apache-2.0"
] | null | null | null | import json
import pprint
import sys
from elasticsearch import Elasticsearch
def get_top_k(query, k=5):
results = es.search(index='python-code', params={"q": query})['hits']['hits'][:k]
for doc in results:
print("Score: ", doc['_score'])
print("Docstring: ", doc['_source']['intent'])
p... | 26.8 | 85 | 0.602612 | import json
import pprint
import sys
from elasticsearch import Elasticsearch
def get_top_k(query, k=5):
results = es.search(index='python-code', params={"q": query})['hits']['hits'][:k]
for doc in results:
print("Score: ", doc['_score'])
print("Docstring: ", doc['_source']['intent'])
p... | true | true |
1c32e058405e630fce30abbd6463173e1df2acbe | 16,138 | py | Python | optimus/helpers/constants.py | liRONCO11/optimus | 0ca0567267300397c7ba711483c46f94ac265e55 | [
"Apache-2.0"
] | null | null | null | optimus/helpers/constants.py | liRONCO11/optimus | 0ca0567267300397c7ba711483c46f94ac265e55 | [
"Apache-2.0"
] | null | null | null | optimus/helpers/constants.py | liRONCO11/optimus | 0ca0567267300397c7ba711483c46f94ac265e55 | [
"Apache-2.0"
] | null | null | null | from enum import Enum
from optimus.helpers.logger import logger
# Python to PySpark reference
#
# type(None): NullType,
# bool: BooleanType,
# int: LongType,
# float: DoubleType,
# str: StringType,
# bytearray: BinaryType,
# decimal.Decimal: DecimalType,
# datetime.date: DateType,
# datetime.datetime: TimestampType,... | 27.680961 | 119 | 0.468212 | from enum import Enum
from optimus.helpers.logger import logger
class Actions(Enum):
PROFILER_DTYPE = "profiler_dtype"
MATCH = "match"
LOWER = "lower"
UPPER = "upper"
PROPER = "proper"
PAD = "pad"
TRIM = "trim"
REVERSE = "reverse"
REMOVE_ACCENTS = "remove"
REMOVE_SPECIAL... | true | true |
1c32e11606263dcf39250cd485f75133e0df204e | 931 | py | Python | surveyapp/app/app/database.py | danielSilva21/interlinker-service-augmenter | 54b6ab3b9f2c21fd4779a03839842534544b9f9b | [
"MIT"
] | null | null | null | surveyapp/app/app/database.py | danielSilva21/interlinker-service-augmenter | 54b6ab3b9f2c21fd4779a03839842534544b9f9b | [
"MIT"
] | null | null | null | surveyapp/app/app/database.py | danielSilva21/interlinker-service-augmenter | 54b6ab3b9f2c21fd4779a03839842534544b9f9b | [
"MIT"
] | null | null | null | import logging
from motor.motor_asyncio import AsyncIOMotorClient, AsyncIOMotorCollection
from app.config import settings
import os
MAX_CONNECTIONS_COUNT = int(os.getenv("MAX_CONNECTIONS_COUNT", 10))
MIN_CONNECTIONS_COUNT = int(os.getenv("MIN_CONNECTIONS_COUNT", 10))
class DataBase:
client: AsyncIOMotorClient = N... | 33.25 | 74 | 0.728249 | import logging
from motor.motor_asyncio import AsyncIOMotorClient, AsyncIOMotorCollection
from app.config import settings
import os
MAX_CONNECTIONS_COUNT = int(os.getenv("MAX_CONNECTIONS_COUNT", 10))
MIN_CONNECTIONS_COUNT = int(os.getenv("MIN_CONNECTIONS_COUNT", 10))
class DataBase:
client: AsyncIOMotorClient = N... | true | true |
1c32e27a764119e0c51f69ff7e5bfdd210ef0fc7 | 4,886 | py | Python | rlpyt/samplers/collectors.py | tristandeleu/rlpyt | 22eccb4e2b33d3c52947a27b6d300b575e36a3ea | [
"MIT"
] | 1 | 2021-04-24T16:42:18.000Z | 2021-04-24T16:42:18.000Z | rlpyt/samplers/collectors.py | tristandeleu/rlpyt | 22eccb4e2b33d3c52947a27b6d300b575e36a3ea | [
"MIT"
] | null | null | null | rlpyt/samplers/collectors.py | tristandeleu/rlpyt | 22eccb4e2b33d3c52947a27b6d300b575e36a3ea | [
"MIT"
] | null | null | null |
import numpy as np
from rlpyt.agents.base import AgentInputs
from rlpyt.utils.buffer import buffer_from_example, torchify_buffer, numpify_buffer
from rlpyt.utils.logging import logger
class BaseCollector:
"""Class that steps environments, possibly in worker process."""
def __init__(
self,
... | 36.192593 | 85 | 0.586779 |
import numpy as np
from rlpyt.agents.base import AgentInputs
from rlpyt.utils.buffer import buffer_from_example, torchify_buffer, numpify_buffer
from rlpyt.utils.logging import logger
class BaseCollector:
def __init__(
self,
rank,
envs,
samples_np,
ba... | true | true |
1c32e4313ba1e38678b13425e96ab2875bc04622 | 1,760 | py | Python | graphrole/graph/interface/__init__.py | dkaslovsky/GraphRole | 5336a9c3c42f8f89565686ed44e321ce6cce1a69 | [
"MIT"
] | 60 | 2019-03-07T15:15:49.000Z | 2022-03-25T19:21:18.000Z | graphrole/graph/interface/__init__.py | dkaslovsky/GraphRole | 5336a9c3c42f8f89565686ed44e321ce6cce1a69 | [
"MIT"
] | 5 | 2020-08-24T08:51:40.000Z | 2021-12-08T06:50:47.000Z | graphrole/graph/interface/__init__.py | dkaslovsky/GraphRole | 5336a9c3c42f8f89565686ed44e321ce6cce1a69 | [
"MIT"
] | 17 | 2019-08-02T04:15:50.000Z | 2022-03-16T21:32:23.000Z | from typing import List, TypeVar
from graphrole.graph.interface.base import BaseGraphInterface
from graphrole.graph.interface.networkx import NetworkxInterface
# IgraphInterface should not be imported if igraph is not installed
try:
from graphrole.graph.interface.igraph import IgraphInterface
except ImportError:
... | 32.592593 | 76 | 0.725568 | from typing import List, TypeVar
from graphrole.graph.interface.base import BaseGraphInterface
from graphrole.graph.interface.networkx import NetworkxInterface
try:
from graphrole.graph.interface.igraph import IgraphInterface
except ImportError:
pass
INTERFACES = {
'networkx': NetworkxInterface,
... | true | true |
1c32e5600b4003e9f85a4060cae7a7cc3ab0c06e | 43 | py | Python | Ejercicio2.0.py | acasasaez/Warm-up | 9b97ee8d7d4a1c6e0b577b392c5fd62d5e1727f3 | [
"Apache-2.0"
] | null | null | null | Ejercicio2.0.py | acasasaez/Warm-up | 9b97ee8d7d4a1c6e0b577b392c5fd62d5e1727f3 | [
"Apache-2.0"
] | null | null | null | Ejercicio2.0.py | acasasaez/Warm-up | 9b97ee8d7d4a1c6e0b577b392c5fd62d5e1727f3 | [
"Apache-2.0"
] | null | null | null | print (chr(27)+ "[0;32;40m" + "Hola Mundo") | 43 | 43 | 0.581395 | print (chr(27)+ "[0;32;40m" + "Hola Mundo") | true | true |
1c32e56a8b489e0337bcce9ebcb6a97161fef89f | 518 | py | Python | plotly/validators/layout/slider/_templateitemname.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/validators/layout/slider/_templateitemname.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 27 | 2020-04-28T21:23:12.000Z | 2021-06-25T15:36:38.000Z | plotly/validators/layout/slider/_templateitemname.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | import _plotly_utils.basevalidators
class TemplateitemnameValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name='templateitemname',
parent_name='layout.slider',
**kwargs
):
super(TemplateitemnameValidator, self).__init__(
... | 27.263158 | 78 | 0.627413 | import _plotly_utils.basevalidators
class TemplateitemnameValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name='templateitemname',
parent_name='layout.slider',
**kwargs
):
super(TemplateitemnameValidator, self).__init__(
... | true | true |
1c32e6ea491d0cdacd28a51303b5f5cb694e4266 | 11,781 | py | Python | landsat/landsat.py | willemarcel/landsat-util | 5804331f4f3d757312931c2ede5714cf7407f60c | [
"CC0-1.0"
] | 1 | 2017-02-17T13:27:09.000Z | 2017-02-17T13:27:09.000Z | landsat/landsat.py | willemarcel/landsat-util | 5804331f4f3d757312931c2ede5714cf7407f60c | [
"CC0-1.0"
] | null | null | null | landsat/landsat.py | willemarcel/landsat-util | 5804331f4f3d757312931c2ede5714cf7407f60c | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python
# USGS Landsat Imagery Util
#
#
# Author: developmentseed
# Contributer: scisco, KAPPS-
#
# License: CC0 1.0 Universal
from __future__ import print_function
import sys
import subprocess
import argparse
import textwrap
import json
from dateutil.parser import parse
from gs_helper import GsHelper... | 39.800676 | 87 | 0.482811 |
from __future__ import print_function
import sys
import subprocess
import argparse
import textwrap
import json
from dateutil.parser import parse
from gs_helper import GsHelper
from clipper_helper import Clipper
from search_helper import Search
from general_helper import reformat_date
from image_helper import Proces... | true | true |
1c32e6f4423ee74d820255630e8ed91535e91b01 | 2,986 | py | Python | tools/ad_map_access_qgis/ad_map_access_qgis/MapSnappingTest.py | woojinjjang/map-1 | d12bb410f03d078a995130b4e671746ace8b6287 | [
"MIT"
] | 61 | 2019-12-19T20:57:24.000Z | 2022-03-29T15:20:51.000Z | tools/ad_map_access_qgis/ad_map_access_qgis/MapSnappingTest.py | woojinjjang/map-1 | d12bb410f03d078a995130b4e671746ace8b6287 | [
"MIT"
] | 54 | 2020-04-05T05:32:47.000Z | 2022-03-15T18:42:33.000Z | tools/ad_map_access_qgis/ad_map_access_qgis/MapSnappingTest.py | woojinjjang/map-1 | d12bb410f03d078a995130b4e671746ace8b6287 | [
"MIT"
] | 31 | 2019-12-20T07:37:39.000Z | 2022-03-16T13:06:16.000Z | # ----------------- BEGIN LICENSE BLOCK ---------------------------------
#
# Copyright (C) 2018-2021 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
# ----------------- END LICENSE BLOCK -----------------------------------
"..."
import ad_map_access as ad
import Globs
from qgis.gui import QgsMapToolEmitPoint
from... | 35.547619 | 202 | 0.543202 | import ad_map_access as ad
import Globs
from qgis.gui import QgsMapToolEmitPoint
from qgis.core import QgsField
from PyQt5.QtCore import QVariant
import qgis.PyQt.QtCore
from .QGISLayer import WGS84PointLayer
class MapSnappingTest(QgsMapToolEmitPoint):
TITLE = "Map-Snapped"
SYMBOL = "diamond"
COLOR = "22... | true | true |
1c32e7e594a8a0d9fba4cbb31dabf80383c02ce9 | 1,190 | py | Python | py/py_0183_maximum_product_of_parts.py | lcsm29/project-euler | fab794ece5aa7a11fc7c2177f26250f40a5b1447 | [
"MIT"
] | null | null | null | py/py_0183_maximum_product_of_parts.py | lcsm29/project-euler | fab794ece5aa7a11fc7c2177f26250f40a5b1447 | [
"MIT"
] | null | null | null | py/py_0183_maximum_product_of_parts.py | lcsm29/project-euler | fab794ece5aa7a11fc7c2177f26250f40a5b1447 | [
"MIT"
] | null | null | null | # Solution of;
# Project Euler Problem 183: Maximum product of parts
# https://projecteuler.net/problem=183
#
# Let N be a positive integer and let N be split into k equal parts, r = N/k,
# so that N = r + r + . . . + r. Let P be the product of these parts, P = r ×
# r × . . . × r = rk. For example, if 11 is split i... | 38.387097 | 79 | 0.633613 | import timed
def dummy(n):
pass
if __name__ == '__main__':
n = 1000
i = 10000
prob_id = 183
timed.caller(dummy, n, i, prob_id)
| true | true |
1c32e9360606b10ab00f8696f91f0d35e73a7e74 | 7,471 | py | Python | fastr/DrivenExtraction.py | remydecoupes/covid19-tweets-mood-tetis | beb3553f7c080f283751d2be14990475008bd82d | [
"CECILL-B"
] | null | null | null | fastr/DrivenExtraction.py | remydecoupes/covid19-tweets-mood-tetis | beb3553f7c080f283751d2be14990475008bd82d | [
"CECILL-B"
] | null | null | null | fastr/DrivenExtraction.py | remydecoupes/covid19-tweets-mood-tetis | beb3553f7c080f283751d2be14990475008bd82d | [
"CECILL-B"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue May 9 14:07:38 2017
For: UMR TETIS RESEARCH UNIT
Author: Gaurav_Shrivastava
"""
import os
import sys
import numpy as np
import pandas as pd
import nltk
import re
import matplotlib as plt
import json
from collections import defaultdict
from nltk.stem.porter impor... | 29.070039 | 119 | 0.681435 | import os
import sys
import numpy as np
import pandas as pd
import nltk
import re
import matplotlib as plt
import json
from collections import defaultdict
from nltk.stem.porter import PorterStemmer
from nltk.corpus import stopwords
from nltk.corpus import wordnet as wn
import argparse
def is_noun(tag):
... | true | true |
1c32e9a0925ed2999d02030f82708738ca6d9199 | 22,061 | py | Python | language/install.py | ritabt/legion | 62d9a513bb85050995b1837d132faddce9c1a8a4 | [
"Apache-2.0"
] | null | null | null | language/install.py | ritabt/legion | 62d9a513bb85050995b1837d132faddce9c1a8a4 | [
"Apache-2.0"
] | null | null | null | language/install.py | ritabt/legion | 62d9a513bb85050995b1837d132faddce9c1a8a4 | [
"Apache-2.0"
] | 1 | 2021-01-07T22:07:18.000Z | 2021-01-07T22:07:18.000Z | #!/usr/bin/env python
# Copyright 2020 Stanford University
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 43.427165 | 127 | 0.627351 |
from __future__ import print_function
import argparse, json, multiprocessing, os, platform, shutil, subprocess, sys
_version = sys.version_info.major
if _version == 2: _input = raw_input
elif _version == 3: _input = input
else:
raise Exception('Incompatible Python version')
make_exe = os.environ.get('... | true | true |
1c32ea71e1a82052c0748ab501146930d51a83c6 | 820 | py | Python | city_scrapers/spiders/cuya_archives_advisory.py | PaulR-Docs/city-scrapers-cle | 00f5db64b64e1ea0ddfa3b7f53d1f5db26c1042d | [
"MIT"
] | 14 | 2019-10-18T15:33:43.000Z | 2021-12-17T17:15:36.000Z | city_scrapers/spiders/cuya_archives_advisory.py | PaulR-Docs/city-scrapers-cle | 00f5db64b64e1ea0ddfa3b7f53d1f5db26c1042d | [
"MIT"
] | 35 | 2020-01-16T15:56:46.000Z | 2022-03-19T18:41:42.000Z | city_scrapers/spiders/cuya_archives_advisory.py | PaulR-Docs/city-scrapers-cle | 00f5db64b64e1ea0ddfa3b7f53d1f5db26c1042d | [
"MIT"
] | 13 | 2019-09-16T18:44:45.000Z | 2022-02-22T20:59:26.000Z | from city_scrapers_core.constants import ADVISORY_COMMITTEE
from city_scrapers_core.spiders import CityScrapersSpider
from city_scrapers.mixins import CuyaCountyMixin
class CuyaArchivesAdvisorySpider(CuyaCountyMixin, CityScrapersSpider):
name = "cuya_archives_advisory"
agency = "Cuyahoga County Archives Advi... | 37.272727 | 88 | 0.729268 | from city_scrapers_core.constants import ADVISORY_COMMITTEE
from city_scrapers_core.spiders import CityScrapersSpider
from city_scrapers.mixins import CuyaCountyMixin
class CuyaArchivesAdvisorySpider(CuyaCountyMixin, CityScrapersSpider):
name = "cuya_archives_advisory"
agency = "Cuyahoga County Archives Advi... | true | true |
1c32ec154452a68a67e0bffdbf3555ccbf090d30 | 12,694 | py | Python | src/bin/feature_extract.py | patrickltobing/shallow-wavenet | a7348805825e47a24e3ad0e759cecfe85284ba9f | [
"Apache-2.0"
] | 19 | 2020-02-28T06:25:26.000Z | 2021-04-22T06:28:16.000Z | src/bin/feature_extract.py | patrickltobing/shallow-wavenet | a7348805825e47a24e3ad0e759cecfe85284ba9f | [
"Apache-2.0"
] | null | null | null | src/bin/feature_extract.py | patrickltobing/shallow-wavenet | a7348805825e47a24e3ad0e759cecfe85284ba9f | [
"Apache-2.0"
] | 1 | 2020-05-03T10:54:59.000Z | 2020-05-03T10:54:59.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2019 Patrick Lumban Tobing (Nagoya University)
# based on PyTorch implementation for WaveNet vocoder by Tomoki Hayashi (Nagoya University)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
from __future__ import division
from __future__ import print_... | 34.778082 | 109 | 0.606507 |
from __future__ import division
from __future__ import print_function
import argparse
import multiprocessing as mp
import os
import sys
from distutils.util import strtobool
import logging
import numpy as np
from numpy.matlib import repmat
from scipy.interpolate import interp1d
from scipy.signal import firwin
from s... | true | true |
1c32ec50134f1af67e3fc4a70e2f7a93960bbedc | 1,162 | py | Python | probs/prob38.py | mattrid93/ProjectEuler | 3e1cf1bad9581e526b37d17e20b5fe8af837c1c6 | [
"MIT"
] | null | null | null | probs/prob38.py | mattrid93/ProjectEuler | 3e1cf1bad9581e526b37d17e20b5fe8af837c1c6 | [
"MIT"
] | null | null | null | probs/prob38.py | mattrid93/ProjectEuler | 3e1cf1bad9581e526b37d17e20b5fe8af837c1c6 | [
"MIT"
] | null | null | null | """Problem 38: Pandigital multiples"""
import unittest
def is_pandigital(n):
"""Tests if n is a 1-9 pandigital"""
if len(str(n)) != 9:
return False
if "0" in str(n):
return False
return len(str(n)) == len(set(str(n)))
def multiply_by_1_m(n):
"""Returns concatenated product of n wit... | 27.023256 | 71 | 0.635972 | import unittest
def is_pandigital(n):
if len(str(n)) != 9:
return False
if "0" in str(n):
return False
return len(str(n)) == len(set(str(n)))
def multiply_by_1_m(n):
conc_product = ""
i = 1
while len(conc_product) < 9:
conc_product += str(n*i)
i += 1
return ... | true | true |
1c32ece427ef557825a544911d926880964c2989 | 1,052 | py | Python | Desafios/Mundo 2/ex065.py | lucasllimati/CursoEmVideo | 01d75626baf8b82f141d62f681e55a9bda0099fd | [
"MIT"
] | null | null | null | Desafios/Mundo 2/ex065.py | lucasllimati/CursoEmVideo | 01d75626baf8b82f141d62f681e55a9bda0099fd | [
"MIT"
] | null | null | null | Desafios/Mundo 2/ex065.py | lucasllimati/CursoEmVideo | 01d75626baf8b82f141d62f681e55a9bda0099fd | [
"MIT"
] | null | null | null | # 65
# Crie um programa que leia vários números inteiros pelo teclado. No final da execução, mostre a média entre todos os valores e qual foi o maior e o menor valores lidos. O programa deve perguntar ao usuário se ele quer ou não continuar a digitar valores.
# Description
# continuar ~> user response 'do you want to ... | 30.057143 | 254 | 0.615019 |
resp = 'S'
cont = 0
soma = 0
maior = 0
menor = 0
media = 0
while resp in 'Ss':
num = int(input('Digite um número: '))
soma += num
cont += 1
if cont == 1:
maior = num
menor = num
else:
if maior < num:
maior = num
if menor > num:
me... | true | true |
1c32ed6ae2c9c4365fc5b168442472f647ec0389 | 2,778 | py | Python | wkz/file_helper/gpx_parser.py | Anyesh/workoutizer | 5cfdef5d08f63d59d6d7d7922540566f6500753b | [
"MIT"
] | 1 | 2021-09-11T16:09:27.000Z | 2021-09-11T16:09:27.000Z | wkz/file_helper/gpx_parser.py | MakhmudovMurod/workoutizer | 1509b711b43875c5f01d62ddbc182b0ee5e23dd2 | [
"MIT"
] | null | null | null | wkz/file_helper/gpx_parser.py | MakhmudovMurod/workoutizer | 1509b711b43875c5f01d62ddbc182b0ee5e23dd2 | [
"MIT"
] | null | null | null | import logging
import gpxpy
import gpxpy.gpx
from wkz.file_helper.parser import Parser
from wkz.gis.geo import get_total_distance_of_trace
log = logging.getLogger(__name__)
class GPXParser(Parser):
def __init__(self, path_to_file: str, md5sum: str):
super(GPXParser, self).__init__(path_to_file, md5sum)... | 36.552632 | 89 | 0.605832 | import logging
import gpxpy
import gpxpy.gpx
from wkz.file_helper.parser import Parser
from wkz.gis.geo import get_total_distance_of_trace
log = logging.getLogger(__name__)
class GPXParser(Parser):
def __init__(self, path_to_file: str, md5sum: str):
super(GPXParser, self).__init__(path_to_file, md5sum)... | true | true |
1c32edfabd39c304d7d0088ece80a414f1b16038 | 3,450 | py | Python | kubernetes/client/models/v1_pod_readiness_gate.py | iguazio/python | c2684bb479d44a49a2010ec4ede5ffa7b17349dd | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1_pod_readiness_gate.py | iguazio/python | c2684bb479d44a49a2010ec4ede5ffa7b17349dd | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1_pod_readiness_gate.py | iguazio/python | c2684bb479d44a49a2010ec4ede5ffa7b17349dd | [
"Apache-2.0"
] | 1 | 2019-01-10T11:13:52.000Z | 2019-01-10T11:13:52.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.13.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re... | 26.953125 | 105 | 0.572754 |
from pprint import pformat
from six import iteritems
import re
class V1PodReadinessGate(object):
swagger_types = {
'condition_type': 'str'
}
attribute_map = {
'condition_type': 'conditionType'
}
def __init__(self, condition_type=None):
self._condition_type = None
... | true | true |
1c32ee85eb0940f440e81b3cb578789a02c6913d | 611 | py | Python | hydragnn/utils/__init__.py | allaffa/HydraGNN | b48f75cd3fe1b0d03bae9af3e6bdc2bb29f8b9c6 | [
"BSD-3-Clause"
] | null | null | null | hydragnn/utils/__init__.py | allaffa/HydraGNN | b48f75cd3fe1b0d03bae9af3e6bdc2bb29f8b9c6 | [
"BSD-3-Clause"
] | null | null | null | hydragnn/utils/__init__.py | allaffa/HydraGNN | b48f75cd3fe1b0d03bae9af3e6bdc2bb29f8b9c6 | [
"BSD-3-Clause"
] | null | null | null | from .print_utils import print_distributed, iterate_tqdm, setup_log
from .distributed import (
get_comm_size_and_rank,
get_device_list,
get_device,
get_device_name,
get_device_from_name,
is_model_distributed,
get_distributed_model,
setup_ddp,
)
from .model import (
save_model,
ge... | 22.62963 | 67 | 0.767594 | from .print_utils import print_distributed, iterate_tqdm, setup_log
from .distributed import (
get_comm_size_and_rank,
get_device_list,
get_device,
get_device_name,
get_device_from_name,
is_model_distributed,
get_distributed_model,
setup_ddp,
)
from .model import (
save_model,
ge... | true | true |
1c32eebf19a7d097e69ba31db590596e3b126e64 | 7,048 | py | Python | shop/models.py | jeffykle/kf-public | 2ea86908709f9903b626e7be192126053f39dfd2 | [
"MIT"
] | null | null | null | shop/models.py | jeffykle/kf-public | 2ea86908709f9903b626e7be192126053f39dfd2 | [
"MIT"
] | null | null | null | shop/models.py | jeffykle/kf-public | 2ea86908709f9903b626e7be192126053f39dfd2 | [
"MIT"
] | null | null | null | from decimal import Decimal
from address.models import AddressField
from django import forms
from django.contrib.auth.models import Group, Permission, User
from django.core.exceptions import ValidationError
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.db import models
from djang... | 33.245283 | 81 | 0.642594 | from decimal import Decimal
from address.models import AddressField
from django import forms
from django.contrib.auth.models import Group, Permission, User
from django.core.exceptions import ValidationError
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.db import models
from djang... | true | true |
1c32eefdfc4cf975266f521a2f569177431466c6 | 6,832 | py | Python | sentry_sdk/integrations/aiohttp.py | Ultimaker/sentry-python | 11b4bae19906cceb2091cafeee458a7f2002e498 | [
"BSD-2-Clause"
] | null | null | null | sentry_sdk/integrations/aiohttp.py | Ultimaker/sentry-python | 11b4bae19906cceb2091cafeee458a7f2002e498 | [
"BSD-2-Clause"
] | null | null | null | sentry_sdk/integrations/aiohttp.py | Ultimaker/sentry-python | 11b4bae19906cceb2091cafeee458a7f2002e498 | [
"BSD-2-Clause"
] | 1 | 2021-02-17T01:38:03.000Z | 2021-02-17T01:38:03.000Z | import sys
import weakref
from sentry_sdk._compat import reraise
from sentry_sdk.hub import Hub
from sentry_sdk.integrations import Integration
from sentry_sdk.integrations.logging import ignore_logger
from sentry_sdk.integrations._wsgi_common import (
_filter_headers,
request_body_within_bounds,
)
from sentry... | 33.655172 | 96 | 0.598507 | import sys
import weakref
from sentry_sdk._compat import reraise
from sentry_sdk.hub import Hub
from sentry_sdk.integrations import Integration
from sentry_sdk.integrations.logging import ignore_logger
from sentry_sdk.integrations._wsgi_common import (
_filter_headers,
request_body_within_bounds,
)
from sentry... | true | true |
1c32f1541522154feb791dd95a0f2cb90fe19515 | 20,451 | py | Python | bin/fence_create.py | themarcelor/fence | 9417655f84752477399e71b58b92c4c333b9704c | [
"Apache-2.0"
] | 31 | 2018-01-05T22:49:33.000Z | 2022-02-02T10:30:23.000Z | bin/fence_create.py | themarcelor/fence | 9417655f84752477399e71b58b92c4c333b9704c | [
"Apache-2.0"
] | 737 | 2017-12-11T17:42:11.000Z | 2022-03-29T22:42:52.000Z | bin/fence_create.py | themarcelor/fence | 9417655f84752477399e71b58b92c4c333b9704c | [
"Apache-2.0"
] | 46 | 2018-02-23T09:04:23.000Z | 2022-02-09T18:29:51.000Z | #!/usr/bin/env python
import argparse
import os
import sys
import logging
from cdislogging import get_logger
from fence.jwt import keys
from fence.config import config
from fence.scripting.fence_create import (
JWTCreator,
create_client_action,
create_or_update_google_bucket,
create_google_logging_bu... | 34.899317 | 108 | 0.643489 |
import argparse
import os
import sys
import logging
from cdislogging import get_logger
from fence.jwt import keys
from fence.config import config
from fence.scripting.fence_create import (
JWTCreator,
create_client_action,
create_or_update_google_bucket,
create_google_logging_bucket,
create_sampl... | true | true |
1c32f183d08380b6732a9658109e07f7e8649d2e | 240 | py | Python | d-series/d462.py | TheLurkingCat/ZeroJudge | 6fc49c54a45e2b4b3a8d04b7a5a1fc81a2ff4eee | [
"MIT"
] | 1 | 2018-10-21T10:03:42.000Z | 2018-10-21T10:03:42.000Z | d-series/d462.py | TheLurkingCat/ZeroJudge | 6fc49c54a45e2b4b3a8d04b7a5a1fc81a2ff4eee | [
"MIT"
] | null | null | null | d-series/d462.py | TheLurkingCat/ZeroJudge | 6fc49c54a45e2b4b3a8d04b7a5a1fc81a2ff4eee | [
"MIT"
] | 2 | 2018-10-12T16:40:11.000Z | 2021-04-05T12:05:36.000Z | while True:
try:
a, n, i, k = [int(x) for x in input().split()]
except EOFError:
break
ans = str(pow(a, n))
print(ans[i-1:i+k-1])
print("From tomcat6 Fri Mar 15 09:53:56 2013\nTo: world\"\nSubject: \"Hello")
| 26.666667 | 77 | 0.558333 | while True:
try:
a, n, i, k = [int(x) for x in input().split()]
except EOFError:
break
ans = str(pow(a, n))
print(ans[i-1:i+k-1])
print("From tomcat6 Fri Mar 15 09:53:56 2013\nTo: world\"\nSubject: \"Hello")
| true | true |
1c32f4c1f8447fcc226b1a407730aab9d1d7083a | 531 | py | Python | setup.py | baek2sm/aithon | bfd9e3f19933026107fb40066bf8db0cfd845242 | [
"MIT"
] | 1 | 2021-12-04T01:18:59.000Z | 2021-12-04T01:18:59.000Z | setup.py | baek2sm/hackathon | bfd9e3f19933026107fb40066bf8db0cfd845242 | [
"MIT"
] | null | null | null | setup.py | baek2sm/hackathon | bfd9e3f19933026107fb40066bf8db0cfd845242 | [
"MIT"
] | null | null | null | import setuptools
setuptools.setup(
name='aithon',
version='0.0.1',
license='MIT',
author='SeungBaek Hong',
author_email='baek2sm@gmail.com',
description='Aithon is a library for use in AI hackathon.',
long_description=open('README.md').read(),
url='https://github.com/baek2sm/aithon',
... | 29.5 | 63 | 0.640301 | import setuptools
setuptools.setup(
name='aithon',
version='0.0.1',
license='MIT',
author='SeungBaek Hong',
author_email='baek2sm@gmail.com',
description='Aithon is a library for use in AI hackathon.',
long_description=open('README.md').read(),
url='https://github.com/baek2sm/aithon',
... | true | true |
1c32f4dce4709950ca69294b7a7f01bd0afc89b8 | 18,100 | py | Python | thread.py | yalhariri/twitter_collector | a411daf029ce86be0f2db0228de8ad360b9ef9ab | [
"MIT"
] | null | null | null | thread.py | yalhariri/twitter_collector | a411daf029ce86be0f2db0228de8ad360b9ef9ab | [
"MIT"
] | null | null | null | thread.py | yalhariri/twitter_collector | a411daf029ce86be0f2db0228de8ad360b9ef9ab | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 11 15:39:05 2020
@author: yalha
"""
import threading
import json
import time
import re
import nltk
import random
tokenizer = nltk.TweetTokenizer()
import requests
import os
from os import path, listdir, remove
from os.path import exists, join
impo... | 43.095238 | 463 | 0.609337 | import threading
import json
import time
import re
import nltk
import random
tokenizer = nltk.TweetTokenizer()
import requests
import os
from os import path, listdir, remove
from os.path import exists, join
import logging
from logging.handlers import TimedRotatingFileHandler as _TimedRotatingFileHandler
import gzip
i... | true | true |
1c32f525161b731d8cc181719533cc70b454f4ed | 1,992 | py | Python | 010/infix_to_postfix.py | gauthamp10/100DaysOfCode | bcc1d02d3cf7ec78770a7645363a88e9930e2115 | [
"MIT"
] | null | null | null | 010/infix_to_postfix.py | gauthamp10/100DaysOfCode | bcc1d02d3cf7ec78770a7645363a88e9930e2115 | [
"MIT"
] | null | null | null | 010/infix_to_postfix.py | gauthamp10/100DaysOfCode | bcc1d02d3cf7ec78770a7645363a88e9930e2115 | [
"MIT"
] | null | null | null | """A funciton to convert a given infix expression
to postfix expression using Shunting Yard Algorithm"""
from stack import MyStack
def infix_to_postfix(infix):
"""Converts given infix expression to postfix expression
using Shunting Yard Algorithm"""
#stack to temporarily store operators and parant... | 38.307692 | 91 | 0.582831 |
from stack import MyStack
def infix_to_postfix(infix):
stack = MyStack(size= len(infix)+1)
postfix = []
is_operand = lambda char: char.isalpha() or char.isnumeric()
PRIORITY = {"+": 1, "-": 1, "*": 2, "/": 2, "%": 2, "^": 3}
precedence = lambda char: PR... | true | true |
1c32f58b1962a49b338c7677b68e6852f2ba5390 | 3,346 | py | Python | middleware/legato/templates/common/bsp_utils.py | automaate/gfx3.8 | 55bf94302f00c8d513c84d910185cef2ca6b5be2 | [
"0BSD"
] | null | null | null | middleware/legato/templates/common/bsp_utils.py | automaate/gfx3.8 | 55bf94302f00c8d513c84d910185cef2ca6b5be2 | [
"0BSD"
] | null | null | null | middleware/legato/templates/common/bsp_utils.py | automaate/gfx3.8 | 55bf94302f00c8d513c84d910185cef2ca6b5be2 | [
"0BSD"
] | null | null | null | # coding: utf-8
##############################################################################
# Copyright (C) 2018 Microchip Technology Inc. and its subsidiaries.
#
# Subject to your compliance with these terms, you may use Microchip software
# and any derivatives exclusively with Microchip products. It is your
... | 33.46 | 124 | 0.724447 | # ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
# THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
##############################################################################
bspSupportList = []
bspSupportObjList = None
class bspSupportObj:
def __init__(self, pinC... | true | true |
1c32f5fc921fedc717d9757873c7c0e3b35ca35d | 4,333 | py | Python | satsense/features/feature.py | fossabot/satsense | 6666dd01a6988a86319c71a8f8802bf4b096c550 | [
"Apache-2.0"
] | 22 | 2018-03-14T10:29:38.000Z | 2022-03-29T10:54:51.000Z | satsense/features/feature.py | fdbesanto2/satsense | b0fa650193995a30328f26a36ebab2437c0e37ef | [
"Apache-2.0"
] | 49 | 2018-05-25T13:28:07.000Z | 2021-07-31T09:48:02.000Z | satsense/features/feature.py | fdbesanto2/satsense | b0fa650193995a30328f26a36ebab2437c0e37ef | [
"Apache-2.0"
] | 11 | 2018-04-24T08:55:28.000Z | 2021-02-17T22:32:05.000Z | from abc import ABC, abstractmethod
class Feature(ABC):
"""
Feature superclass.
Parameters
----------
window_shapes : list[tuple]
List of tuples of window shapes to calculate the feature on
**kwargs : dict
Keyword arguments for the feature
Attributes
-... | 25.19186 | 77 | 0.560582 | from abc import ABC, abstractmethod
class Feature(ABC):
base_image = None
size = None
def __init__(self, window_shapes, **kwargs):
self._indices = {}
self._length = 0
self._windows = tuple(sorted(window_shapes, reverse=True))
self.kwargs = kwargs
self.name = self... | true | true |
1c32f72e07a1f6cfb11be0c78d0d706399c65872 | 35,697 | py | Python | python/ray/tune/test/trial_scheduler_test.py | yfletberliac/ray | 2fd48afa082af012420c3e1a3240e3904cf72c04 | [
"Apache-2.0"
] | 29 | 2019-05-18T12:18:34.000Z | 2022-03-30T01:46:48.000Z | ray/tune/test/trial_scheduler_test.py | kivo360/tesp | a77d9c228a6891b304e789ba2758a4cbfdb75ec0 | [
"MIT"
] | 8 | 2019-08-15T05:42:10.000Z | 2021-05-21T09:41:15.000Z | ray/tune/test/trial_scheduler_test.py | kivo360/tesp | a77d9c228a6891b304e789ba2758a4cbfdb75ec0 | [
"MIT"
] | 8 | 2019-07-15T22:36:20.000Z | 2020-08-09T07:03:26.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import random
import unittest
import numpy as np
import ray
from ray.tune.schedulers import (HyperBandScheduler, AsyncHyperBandScheduler,
PopulationBasedTraining, MedianStoppin... | 39.184413 | 79 | 0.60837 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import random
import unittest
import numpy as np
import ray
from ray.tune.schedulers import (HyperBandScheduler, AsyncHyperBandScheduler,
PopulationBasedTraining, MedianStoppin... | true | true |
1c32f8b1da1b45f5c2b37ac0c668b07eb2a168b1 | 3,197 | py | Python | xmodaler/utils/colormap.py | cclauss/xmodaler | 1368fba6c550e97008628edbf01b59a0a6c8fde5 | [
"Apache-2.0"
] | 830 | 2021-06-26T07:16:33.000Z | 2022-03-25T10:31:32.000Z | xmodaler/utils/colormap.py | kevinjunwei/xmodaler | 3e128a816876988c5fb07d842fde4a140e699dde | [
"Apache-2.0"
] | 28 | 2021-08-19T12:39:02.000Z | 2022-03-14T13:04:19.000Z | xmodaler/utils/colormap.py | kevinjunwei/xmodaler | 3e128a816876988c5fb07d842fde4a140e699dde | [
"Apache-2.0"
] | 85 | 2021-08-15T06:58:29.000Z | 2022-02-19T07:30:56.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
"""
An awesome colormap for really neat visualizations.
Copied from Detectron, and removed gray colors.
"""
import numpy as np
__all__ = ["colormap", "random_color"]
# fmt: off
# RGB:
_COLORS = np.array(
[
0.000, 0.447, 0.741,
0.850, 0.325, 0.09... | 25.782258 | 75 | 0.474195 |
import numpy as np
__all__ = ["colormap", "random_color"]
_COLORS = np.array(
[
0.000, 0.447, 0.741,
0.850, 0.325, 0.098,
0.929, 0.694, 0.125,
0.494, 0.184, 0.556,
0.466, 0.674, 0.188,
0.301, 0.745, 0.933,
0.635, 0.078, 0.184,
0.300, 0.300, 0.300,
... | true | true |
1c32f8fbb92ee5978bbd98488f6b44b6b6a6c68b | 1,619 | py | Python | pages/migrations/0001_initial.py | mikehagquist/fitapps3 | 43b46cd475e635fd9ab9542960a65197941a0172 | [
"MIT"
] | null | null | null | pages/migrations/0001_initial.py | mikehagquist/fitapps3 | 43b46cd475e635fd9ab9542960a65197941a0172 | [
"MIT"
] | 3 | 2020-02-11T23:58:50.000Z | 2021-06-10T21:32:19.000Z | pages/migrations/0001_initial.py | mikehagquist/fitapps3 | 43b46cd475e635fd9ab9542960a65197941a0172 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.2 on 2019-03-21 11:42
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUT... | 35.977778 | 120 | 0.594194 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
... | true | true |
1c32fad27afe9a2b54ac92330f5bf52a9aa3472c | 103 | py | Python | src/config_mnist_train.py | RaulRC/genetic-neural-optimizer | fa169cdc9b43c58470c3e7a7214185d56e61579a | [
"MIT"
] | 1 | 2021-04-30T09:07:15.000Z | 2021-04-30T09:07:15.000Z | src/config_mnist_train.py | RaulRC/genetic-neural-optimizer | fa169cdc9b43c58470c3e7a7214185d56e61579a | [
"MIT"
] | 5 | 2020-01-28T23:00:10.000Z | 2022-02-10T00:16:05.000Z | src/config_mnist_train.py | RaulRC/genetic-neural-optimizer | fa169cdc9b43c58470c3e7a7214185d56e61579a | [
"MIT"
] | null | null | null | iterations = 5
generations_list = [500]
populations_list = [6]
elitism_list = [0.5]
mutables_list = [1] | 20.6 | 24 | 0.728155 | iterations = 5
generations_list = [500]
populations_list = [6]
elitism_list = [0.5]
mutables_list = [1] | true | true |
1c32fbac352e7981530d8bb51524d93d32c8814e | 41,572 | py | Python | pydl_image_encoders/library/tf/imagenet_utils.py | chen0040/pydl-image-encoders | 73c0fb02842fabf824fe78735a180dcc0570624d | [
"MIT"
] | 1 | 2018-03-18T21:46:33.000Z | 2018-03-18T21:46:33.000Z | pydl_image_encoders/library/tf/imagenet_utils.py | chen0040/pydl-image-encoders | 73c0fb02842fabf824fe78735a180dcc0570624d | [
"MIT"
] | null | null | null | pydl_image_encoders/library/tf/imagenet_utils.py | chen0040/pydl-image-encoders | 73c0fb02842fabf824fe78735a180dcc0570624d | [
"MIT"
] | 1 | 2018-03-18T21:46:34.000Z | 2018-03-18T21:46:34.000Z | imagenet_labels = {0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, c... | 41.53047 | 141 | 0.500674 | imagenet_labels = {0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, c... | true | true |
1c32fdb227564e56f103f322d9d23eee416880fb | 14,455 | py | Python | src/sdk/pynni/nni/compression/torch/utils/shape_dependency.py | CuriousCat-7/nni | 66057ba74c5252e38a576712b59a8bf867e2d514 | [
"MIT"
] | 3 | 2021-04-19T08:26:46.000Z | 2022-03-22T20:17:17.000Z | src/sdk/pynni/nni/compression/torch/utils/shape_dependency.py | CuriousCat-7/nni | 66057ba74c5252e38a576712b59a8bf867e2d514 | [
"MIT"
] | 21 | 2020-11-13T19:01:01.000Z | 2022-02-27T09:12:51.000Z | src/sdk/pynni/nni/compression/torch/utils/shape_dependency.py | CuriousCat-7/nni | 66057ba74c5252e38a576712b59a8bf867e2d514 | [
"MIT"
] | 3 | 2020-10-23T02:53:47.000Z | 2020-11-15T22:05:09.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import csv
import logging
__all__ = ['ChannelDependency', 'GroupDependency', 'CatPaddingDependency']
CONV_TYPE = 'aten::_convolution'
ADD_TYPES = ['aten::add', 'aten::add_']
CAT_TYPE = 'aten::cat'
logger = logging.getLogger('Shape_Dependency')
... | 37.643229 | 97 | 0.576825 |
import csv
import logging
__all__ = ['ChannelDependency', 'GroupDependency', 'CatPaddingDependency']
CONV_TYPE = 'aten::_convolution'
ADD_TYPES = ['aten::add', 'aten::add_']
CAT_TYPE = 'aten::cat'
logger = logging.getLogger('Shape_Dependency')
class Dependency:
def __init__(self, model=None, dummy_input=None, ... | true | true |
1c330062e0a400ccec94be55403fe68eeb51645a | 30,197 | py | Python | keras/layers/preprocessing/index_lookup.py | kanesp/keras | 7f8c62b90274f9c5a261984c098312ff8fab3d66 | [
"Apache-2.0"
] | 1 | 2021-03-16T09:37:55.000Z | 2021-03-16T09:37:55.000Z | keras/layers/preprocessing/index_lookup.py | kanesp/keras | 7f8c62b90274f9c5a261984c098312ff8fab3d66 | [
"Apache-2.0"
] | null | null | null | keras/layers/preprocessing/index_lookup.py | kanesp/keras | 7f8c62b90274f9c5a261984c098312ff8fab3d66 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The TensorFlow 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 applica... | 42.11576 | 80 | 0.675498 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow.compat.v2 as tf
import collections
import json
import operator
import numpy as np
from keras import backend as K
from keras.engine import base_preprocessing_layer
from keras.layers.preproces... | true | true |
1c33009f274ee36e4bf41a2d5ea5c86909d87893 | 595 | py | Python | test_project/manage.py | bigsassy/django-facetools | aeedaea81ab0007ee8e96b2f81f1404dc8bddb3c | [
"MIT"
] | 2 | 2018-01-24T20:41:27.000Z | 2019-06-27T13:24:18.000Z | test_project/manage.py | bigsassy/django-facetools | aeedaea81ab0007ee8e96b2f81f1404dc8bddb3c | [
"MIT"
] | null | null | null | test_project/manage.py | bigsassy/django-facetools | aeedaea81ab0007ee8e96b2f81f1404dc8bddb3c | [
"MIT"
] | null | null | null | import os
import sys
from django.core.management import execute_manager
import imp
pwd = os.path.dirname(__file__)
sys.path.append(os.path.abspath(os.path.join(pwd, '../')))
try:
imp.find_module('settings') # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can'... | 29.75 | 216 | 0.739496 | import os
import sys
from django.core.management import execute_manager
import imp
pwd = os.path.dirname(__file__)
sys.path.append(os.path.abspath(os.path.join(pwd, '../')))
try:
imp.find_module('settings') except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the di... | true | true |
1c3301b06f2c47aee6adc2cd1044485633064ee5 | 16,709 | py | Python | nmt/joint/csimplejoint.py | Roxot/AEVNMT | 5ebc6ec76b2c891ab76a5584a15e735145fdc43b | [
"Apache-2.0"
] | 15 | 2018-07-30T13:19:58.000Z | 2019-10-20T13:58:10.000Z | nmt/joint/csimplejoint.py | Roxot/AEVNMT | 5ebc6ec76b2c891ab76a5584a15e735145fdc43b | [
"Apache-2.0"
] | null | null | null | nmt/joint/csimplejoint.py | Roxot/AEVNMT | 5ebc6ec76b2c891ab76a5584a15e735145fdc43b | [
"Apache-2.0"
] | null | null | null | """
:Authors: - Bryan Eikema
"""
import tensorflow as tf
import nmt.utils.misc_utils as utils
from . import DSimpleJointModel
from nmt import model_helper
from .utils import language_model
from nmt.utils.gaussianhelper import GaussianHelper
from nmt.utils.amt_utils import enrich_embeddings_with_positions, self_atten... | 41.155172 | 119 | 0.707283 |
import tensorflow as tf
import nmt.utils.misc_utils as utils
from . import DSimpleJointModel
from nmt import model_helper
from .utils import language_model
from nmt.utils.gaussianhelper import GaussianHelper
from nmt.utils.amt_utils import enrich_embeddings_with_positions, self_attention_layer, diagonal_attention_co... | true | true |
1c33045044c41d07abe899c546597c89767ac0a5 | 3,457 | py | Python | services/models.py | Jordzman/explorer | d0b796014320761cd751429a9dc6ad48fe90ed96 | [
"Apache-2.0"
] | 2 | 2016-08-07T02:59:23.000Z | 2016-08-21T23:48:03.000Z | services/models.py | Trevorulliac/explorer | d2f836afd0b827041b1c75a8dd056fdb2beb2e1d | [
"Apache-2.0"
] | 29 | 2020-05-01T08:05:16.000Z | 2021-06-25T15:36:13.000Z | services/models.py | Trevorulliac/explorer | d2f836afd0b827041b1c75a8dd056fdb2beb2e1d | [
"Apache-2.0"
] | 1 | 2016-02-09T21:47:34.000Z | 2016-02-09T21:47:34.000Z | from django.db import models
from blockexplorer.raven import client
from jsonfield import JSONField
from utils import get_client_ip, uri_to_url, is_good_status_code, get_user_agent
import json
import requests
class APICall(models.Model):
"""
To keep track of all our external API calls and aid in debugging... | 37.576087 | 111 | 0.689037 | from django.db import models
from blockexplorer.raven import client
from jsonfield import JSONField
from utils import get_client_ip, uri_to_url, is_good_status_code, get_user_agent
import json
import requests
class APICall(models.Model):
API_NAME_CHOICES = ()
created_at = models.DateTimeField(auto_n... | true | true |
1c33046ed0d758165c4c2cf5afaa8e2465772ca8 | 341 | py | Python | Tests/__init__.py | Jakar510/PythonExtensions | f29600f73454d21345f6da893a1df1b71ddacd0b | [
"MIT"
] | null | null | null | Tests/__init__.py | Jakar510/PythonExtensions | f29600f73454d21345f6da893a1df1b71ddacd0b | [
"MIT"
] | null | null | null | Tests/__init__.py | Jakar510/PythonExtensions | f29600f73454d21345f6da893a1df1b71ddacd0b | [
"MIT"
] | null | null | null | # ------------------------------------------------------------------------------
# Created by Tyler Stegmaier
# Copyright (c) 2021.
#
# ------------------------------------------------------------------------------
from .SwitchCase import *
from .test_tk import *
from .tests import *
def Run():
import unittest... | 22.733333 | 80 | 0.354839 |
from .SwitchCase import *
from .test_tk import *
from .tests import *
def Run():
import unittest
unittest.main()
| true | true |
1c33060502174fd1ff63d68472a286c693fcc071 | 249 | py | Python | kader/kader/doctype/custody/custody.py | Muad96/kader | 287d37d110ec2058256d4936d3ef69345781e1a5 | [
"MIT"
] | null | null | null | kader/kader/doctype/custody/custody.py | Muad96/kader | 287d37d110ec2058256d4936d3ef69345781e1a5 | [
"MIT"
] | null | null | null | kader/kader/doctype/custody/custody.py | Muad96/kader | 287d37d110ec2058256d4936d3ef69345781e1a5 | [
"MIT"
] | 1 | 2021-08-01T13:47:36.000Z | 2021-08-01T13:47:36.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2019, KABCO and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class Custody(Document):
pass
| 22.636364 | 49 | 0.7751 |
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class Custody(Document):
pass
| true | true |
1c33065e10b05c1e01c2284f426936a6e62f4a23 | 1,249 | py | Python | python/paddle/fluid/tests/unittests/test_is_integer.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 8 | 2016-08-15T07:02:27.000Z | 2016-08-24T09:34:00.000Z | python/paddle/fluid/tests/unittests/test_is_integer.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 1 | 2021-11-01T06:28:16.000Z | 2021-11-01T06:28:16.000Z | python/paddle/fluid/tests/unittests/test_is_integer.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 5 | 2021-12-10T11:20:06.000Z | 2022-02-18T05:18:12.000Z | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | 31.225 | 74 | 0.703763 |
import paddle
import numpy as np
import unittest
class TestIsInteger(unittest.TestCase):
def test_for_integer(self):
x = paddle.arange(10)
self.assertTrue(paddle.is_integer(x))
def test_for_floating_point(self):
x = paddle.randn([2, 3])
self.assertFalse(paddle.is_integer(x))
... | true | true |
1c33077976c61c4be83e2036907ca191f93bc51d | 11,718 | py | Python | os_brick/tests/encryptors/test_luks.py | ebalduf/os-brick-backports | 6a180265560d5e0bab80e47ac25c15906d1165fb | [
"Apache-2.0"
] | null | null | null | os_brick/tests/encryptors/test_luks.py | ebalduf/os-brick-backports | 6a180265560d5e0bab80e47ac25c15906d1165fb | [
"Apache-2.0"
] | null | null | null | os_brick/tests/encryptors/test_luks.py | ebalduf/os-brick-backports | 6a180265560d5e0bab80e47ac25c15906d1165fb | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory
# 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/... | 45.595331 | 78 | 0.602577 |
import binascii
import mock
import uuid
from castellan.common.objects import symmetric_key as key
from os_brick.encryptors import luks
from os_brick.tests.encryptors import test_cryptsetup
from oslo_concurrency import processutils as putils
class LuksEncryptorTestCase(test_cryptsetup.CryptsetupEncryptorTestCase):
... | true | true |
1c3307cede4860fba7a140ac76e94cbe6915d805 | 390 | py | Python | USMAN_MURTALA_ABDULLAHI/python assignment.py | Abdulusy/cil-internship-cohort-02 | 32571631567a8fbae24a83acad668ca0bf476f2c | [
"MIT"
] | null | null | null | USMAN_MURTALA_ABDULLAHI/python assignment.py | Abdulusy/cil-internship-cohort-02 | 32571631567a8fbae24a83acad668ca0bf476f2c | [
"MIT"
] | null | null | null | USMAN_MURTALA_ABDULLAHI/python assignment.py | Abdulusy/cil-internship-cohort-02 | 32571631567a8fbae24a83acad668ca0bf476f2c | [
"MIT"
] | null | null | null | import cv2
from cv2 import INTER_AREA
img = cv2.read("mm.jpg")
scale_percent=0.50
width=int(img.shape[1]*scale_percent)
height=int(img.shape[0]*scale_percent)
dimension=(width,height)
resized=cv2.resize(img,dimension,interpolation=INTER_AREA)
print(resized.shape)
cv2.imshow('outout', resized)
cv2.imwrite('r... | 24.375 | 59 | 0.75641 | import cv2
from cv2 import INTER_AREA
img = cv2.read("mm.jpg")
scale_percent=0.50
width=int(img.shape[1]*scale_percent)
height=int(img.shape[0]*scale_percent)
dimension=(width,height)
resized=cv2.resize(img,dimension,interpolation=INTER_AREA)
print(resized.shape)
cv2.imshow('outout', resized)
cv2.imwrite('r... | true | true |
1c33086347508a4ad3a1ba5a83f4b8ecd0df0c04 | 268 | py | Python | tests/artificial/transf_Integration/trend_LinearTrend/cycle_5/ar_/test_artificial_32_Integration_LinearTrend_5__100.py | shaido987/pyaf | b9afd089557bed6b90b246d3712c481ae26a1957 | [
"BSD-3-Clause"
] | 377 | 2016-10-13T20:52:44.000Z | 2022-03-29T18:04:14.000Z | tests/artificial/transf_Integration/trend_LinearTrend/cycle_5/ar_/test_artificial_32_Integration_LinearTrend_5__100.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 160 | 2016-10-13T16:11:53.000Z | 2022-03-28T04:21:34.000Z | tests/artificial/transf_Integration/trend_LinearTrend/cycle_5/ar_/test_artificial_32_Integration_LinearTrend_5__100.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 63 | 2017-03-09T14:51:18.000Z | 2022-03-27T20:52:57.000Z | import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "LinearTrend", cycle_length = 5, transform = "Integration", sigma = 0.0, exog_count = 100, ar_order = 0); | 38.285714 | 168 | 0.735075 | import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "LinearTrend", cycle_length = 5, transform = "Integration", sigma = 0.0, exog_count = 100, ar_order = 0); | true | true |
1c330a28529e1fc48cb5c5a2804c113dc5d0059d | 1,954 | py | Python | lib/gcloud/logging/connection.py | huangkuan/hack | 433e213915749d9c510abf3c7462d5256b5e37eb | [
"Apache-2.0"
] | 1 | 2019-02-06T10:58:11.000Z | 2019-02-06T10:58:11.000Z | lib/gcloud/logging/connection.py | huangkuan/hack | 433e213915749d9c510abf3c7462d5256b5e37eb | [
"Apache-2.0"
] | 4 | 2017-10-24T21:47:53.000Z | 2019-09-22T13:12:57.000Z | lib/gcloud/logging/connection.py | huangkuan/hack | 433e213915749d9c510abf3c7462d5256b5e37eb | [
"Apache-2.0"
] | 2 | 2017-02-09T16:25:27.000Z | 2017-10-24T21:40:42.000Z | # Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 39.877551 | 77 | 0.697544 |
from gcloud import connection as base_connection
class Connection(base_connection.JSONConnection):
API_BASE_URL = 'https://logging.googleapis.com'
API_VERSION = 'v2beta1'
API_URL_TEMPLATE = '{api_base_url}/{api_version}{path}'
SCOPE = ('https://www.googleapis.com/auth/logging.read',
... | true | true |
1c330af6422c580419cba5ae220b45442bd3d372 | 24,375 | py | Python | praw/models/reddit/submission.py | RichardHoekstra/praw | 04c3056d146ab905d6b58d6502b8f4d1d9fb4435 | [
"BSD-2-Clause"
] | null | null | null | praw/models/reddit/submission.py | RichardHoekstra/praw | 04c3056d146ab905d6b58d6502b8f4d1d9fb4435 | [
"BSD-2-Clause"
] | null | null | null | praw/models/reddit/submission.py | RichardHoekstra/praw | 04c3056d146ab905d6b58d6502b8f4d1d9fb4435 | [
"BSD-2-Clause"
] | null | null | null | """Provide the Submission class."""
from typing import Any, Dict, List, Optional, TypeVar, Union
from urllib.parse import urljoin
from prawcore import Conflict
from ...const import API_PATH
from ...exceptions import InvalidURL
from ...util.cache import cachedproperty
from ..comment_forest import CommentForest
from ..... | 33.667127 | 85 | 0.581538 | from typing import Any, Dict, List, Optional, TypeVar, Union
from urllib.parse import urljoin
from prawcore import Conflict
from ...const import API_PATH
from ...exceptions import InvalidURL
from ...util.cache import cachedproperty
from ..comment_forest import CommentForest
from ..listing.listing import Listing
from ... | true | true |
1c330b0f0181bf6c532f368e8052f97542502d53 | 79,228 | py | Python | src/aks-preview/azext_aks_preview/tests/latest/test_decorator.py | Arkanayan/azure-cli-extensions | b45ca4061e0428d6438e0a8fb9436994f0205949 | [
"MIT"
] | 4 | 2019-08-20T02:58:03.000Z | 2020-05-22T10:23:11.000Z | src/aks-preview/azext_aks_preview/tests/latest/test_decorator.py | Arkanayan/azure-cli-extensions | b45ca4061e0428d6438e0a8fb9436994f0205949 | [
"MIT"
] | 4 | 2019-08-29T07:20:57.000Z | 2021-12-21T10:04:53.000Z | src/aks-preview/azext_aks_preview/tests/latest/test_decorator.py | Arkanayan/azure-cli-extensions | b45ca4061e0428d6438e0a8fb9436994f0205949 | [
"MIT"
] | 4 | 2019-08-29T02:52:14.000Z | 2021-09-14T10:41:48.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 37.926281 | 126 | 0.607083 |
import importlib
import unittest
from unittest.mock import Mock, patch
import requests
from azext_aks_preview.__init__ import register_aks_preview_resource_type
from azext_aks_preview._client_factory import CUSTOM_MGMT_AKS_PREVIEW
from azext_aks_preview._consts import (
ADDONS,
CONST_ACC_SGX_QUOTE_HELPER_ENAB... | true | true |
1c330b1729e9ea2a5375109526f749c310ba72a2 | 9,272 | py | Python | nets.py | asappinc/emergent_comms_negotiation | 19ad405dcb83a3a521b6e1752cec075b69aa164b | [
"MIT"
] | 9 | 2020-03-04T13:24:25.000Z | 2022-03-15T09:52:37.000Z | nets.py | asappinc/emergent_comms_negotiation | 19ad405dcb83a3a521b6e1752cec075b69aa164b | [
"MIT"
] | 2 | 2019-12-30T07:28:33.000Z | 2020-10-13T11:38:34.000Z | nets.py | asappinc/emergent_comms_negotiation | 19ad405dcb83a3a521b6e1752cec075b69aa164b | [
"MIT"
] | 6 | 2018-03-15T18:08:45.000Z | 2019-07-15T06:49:16.000Z | import torch
from torch import nn, autograd
from torch.autograd import Variable
import torch.nn.functional as F
class NumberSequenceEncoder(nn.Module):
def __init__(self, num_values, embedding_size=100):
"""
eg for values 0,1,2,3,4,5, num_values will be: 6
for 0,1,..,9 num_values will be: ... | 36.503937 | 135 | 0.612058 | import torch
from torch import nn, autograd
from torch.autograd import Variable
import torch.nn.functional as F
class NumberSequenceEncoder(nn.Module):
def __init__(self, num_values, embedding_size=100):
super().__init__()
self.embedding_size = embedding_size
self.num_values = num_values
... | true | true |
1c330bb9ecd571857f9b054f2104c084f9a82eb4 | 7,983 | py | Python | Bag of Features/preprocessing_surf.py | varunsingh251/Indian-Sign-Language-Recognition | 07eb060f4c22821e69351b0931ebaadc2e9193a8 | [
"MIT"
] | 147 | 2017-12-08T19:52:18.000Z | 2022-02-23T04:40:02.000Z | Bag of Features/preprocessing_surf.py | hyper07/Indian-Sign-Language-Recognition | 40604e5c0a2a9b6310e26c0fa31b4f4f1c30de45 | [
"MIT"
] | 13 | 2018-01-26T19:21:34.000Z | 2021-11-15T11:53:30.000Z | Bag of Features/preprocessing_surf.py | hyper07/Indian-Sign-Language-Recognition | 40604e5c0a2a9b6310e26c0fa31b4f4f1c30de45 | [
"MIT"
] | 86 | 2017-11-20T10:23:08.000Z | 2022-03-30T14:39:36.000Z | import numpy as np
import cv2
import os
import csv
import sklearn.metrics as sm
from surf_image_processing import func,func2
from sklearn.cluster import MiniBatchKMeans
from sklearn.svm import SVC
from sklearn.grid_search import GridSearchCV
import random
import warnings
import pickle
from sklearn.naive_bayes import Ga... | 36.619266 | 162 | 0.716523 | import numpy as np
import cv2
import os
import csv
import sklearn.metrics as sm
from surf_image_processing import func,func2
from sklearn.cluster import MiniBatchKMeans
from sklearn.svm import SVC
from sklearn.grid_search import GridSearchCV
import random
import warnings
import pickle
from sklearn.naive_bayes import Ga... | true | true |
1c330bd99ebe226153876feb67b2d0e928a6c4c2 | 373 | py | Python | companies/migrations/0012_remove_company_is_listed.py | Valuehorizon/valuehorizon-companies | 5366e230da69ee30fcdc1bf4beddc99310f6b767 | [
"MIT"
] | 1 | 2015-09-28T17:11:12.000Z | 2015-09-28T17:11:12.000Z | companies/migrations/0012_remove_company_is_listed.py | Valuehorizon/valuehorizon-companies | 5366e230da69ee30fcdc1bf4beddc99310f6b767 | [
"MIT"
] | 4 | 2020-02-11T22:59:54.000Z | 2021-06-10T17:55:15.000Z | companies/migrations/0012_remove_company_is_listed.py | Valuehorizon/valuehorizon-companies | 5366e230da69ee30fcdc1bf4beddc99310f6b767 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('companies', '0011_company_latest_incorporation_date'),
]
operations = [
migrations.RemoveField(
model_name='comp... | 19.631579 | 64 | 0.624665 | from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('companies', '0011_company_latest_incorporation_date'),
]
operations = [
migrations.RemoveField(
model_name='company',
name='... | true | true |
1c330c30ecf527114842ab07626b84a090588d9a | 481 | py | Python | sample_dashboard/sample_dashboard/urls.py | Georgitanev/django_dashboard | 5be2680712fcedf33965fd66a69d46e1e32ab04b | [
"MIT"
] | null | null | null | sample_dashboard/sample_dashboard/urls.py | Georgitanev/django_dashboard | 5be2680712fcedf33965fd66a69d46e1e32ab04b | [
"MIT"
] | null | null | null | sample_dashboard/sample_dashboard/urls.py | Georgitanev/django_dashboard | 5be2680712fcedf33965fd66a69d46e1e32ab04b | [
"MIT"
] | null | null | null | from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include
from django.urls import path
from django.views.generic import RedirectView
urlpatterns = [
path("admin/", admin.site.urls),
path("google_analytics/", include("google_anal... | 37 | 77 | 0.777547 | from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include
from django.urls import path
from django.views.generic import RedirectView
urlpatterns = [
path("admin/", admin.site.urls),
path("google_analytics/", include("google_anal... | true | true |
1c330c5d095231e2570eaac069980322ec14776b | 8,534 | py | Python | releasenotes/source/conf.py | openstack/puppet-rally | f6521d64b11bca1da14a6f7848ba82284b348299 | [
"Apache-2.0"
] | 18 | 2016-01-03T07:26:56.000Z | 2019-04-12T09:22:39.000Z | releasenotes/source/conf.py | openstack/puppet-rally | f6521d64b11bca1da14a6f7848ba82284b348299 | [
"Apache-2.0"
] | null | null | null | releasenotes/source/conf.py | openstack/puppet-rally | f6521d64b11bca1da14a6f7848ba82284b348299 | [
"Apache-2.0"
] | 2 | 2016-01-21T07:39:32.000Z | 2017-06-15T08:18:00.000Z | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software... | 33.206226 | 104 | 0.724045 |
extensions = [
'openstackdocstheme',
'reno.sphinxext',
]
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
copyright = u'2016, Puppet OpenStack Developers'
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y versio... | true | true |
1c330c9e85e20a00de1d955a4dbf54c1475c417e | 263 | py | Python | calculator_functions.py | simeckova/special_button_clicker | c49de7b8d18d30327d48ad782e1f2c92e9717da9 | [
"MIT"
] | null | null | null | calculator_functions.py | simeckova/special_button_clicker | c49de7b8d18d30327d48ad782e1f2c92e9717da9 | [
"MIT"
] | null | null | null | calculator_functions.py | simeckova/special_button_clicker | c49de7b8d18d30327d48ad782e1f2c92e9717da9 | [
"MIT"
] | null | null | null | def times_2(n: float) -> float:
return n * 2
def minus_7(n: float) -> float:
return n - 7
def plus_13(n: float) -> float:
return n + 13
def divide_by_3(n: float) -> float:
return n // 3
functions = [times_2, minus_7, plus_13, divide_by_3]
| 14.611111 | 52 | 0.61597 | def times_2(n: float) -> float:
return n * 2
def minus_7(n: float) -> float:
return n - 7
def plus_13(n: float) -> float:
return n + 13
def divide_by_3(n: float) -> float:
return n // 3
functions = [times_2, minus_7, plus_13, divide_by_3]
| true | true |
1c330ceb4e2f4e081fbe6fa36dd495cd2737e107 | 6,686 | py | Python | homeassistant/components/ecobee/weather.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 30,023 | 2016-04-13T10:17:53.000Z | 2020-03-02T12:56:31.000Z | homeassistant/components/ecobee/weather.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 24,710 | 2016-04-13T08:27:26.000Z | 2020-03-02T12:59:13.000Z | homeassistant/components/ecobee/weather.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 11,956 | 2016-04-13T18:42:31.000Z | 2020-03-02T09:32:12.000Z | """Support for displaying weather info from Ecobee API."""
from __future__ import annotations
from datetime import timedelta
from pyecobee.const import ECOBEE_STATE_UNKNOWN
from homeassistant.components.weather import (
ATTR_FORECAST_CONDITION,
ATTR_FORECAST_TEMP,
ATTR_FORECAST_TEMP_LOW,
ATTR_FORECAS... | 30.52968 | 87 | 0.630123 | from __future__ import annotations
from datetime import timedelta
from pyecobee.const import ECOBEE_STATE_UNKNOWN
from homeassistant.components.weather import (
ATTR_FORECAST_CONDITION,
ATTR_FORECAST_TEMP,
ATTR_FORECAST_TEMP_LOW,
ATTR_FORECAST_TIME,
ATTR_FORECAST_WIND_BEARING,
ATTR_FORECAST_W... | true | true |
1c330d018b9287d66eea4498799152cb017ab675 | 928 | py | Python | website/orders/urls.py | KiOui/TOSTI | 72e65889c193727dcf3e3716b10c78a9774e1136 | [
"MIT"
] | 1 | 2020-05-10T21:10:43.000Z | 2020-05-10T21:10:43.000Z | website/orders/urls.py | KiOui/TOSTI | 72e65889c193727dcf3e3716b10c78a9774e1136 | [
"MIT"
] | 158 | 2020-05-04T12:37:41.000Z | 2022-03-31T20:15:07.000Z | website/orders/urls.py | KiOui/TOSTI | 72e65889c193727dcf3e3716b10c78a9774e1136 | [
"MIT"
] | null | null | null | from django.urls import path, register_converter
from orders import views
from .converters import ShiftConverter, OrderVenueConverter, OrderConverter
register_converter(ShiftConverter, "shift")
register_converter(OrderVenueConverter, "order_venue")
register_converter(OrderConverter, "order")
urlpatterns = [
path... | 48.842105 | 100 | 0.75431 | from django.urls import path, register_converter
from orders import views
from .converters import ShiftConverter, OrderVenueConverter, OrderConverter
register_converter(ShiftConverter, "shift")
register_converter(OrderVenueConverter, "order_venue")
register_converter(OrderConverter, "order")
urlpatterns = [
path... | true | true |
1c330d019b36bb4f9d251d15e0a2a2e7de7abdc7 | 3,956 | py | Python | paas-ce/paas/esb/components/bk/apisv2/bk_paas/create_app.py | renmcc/bk-PaaS | 1c9e4e9cfb40fc3375cd6b5f08af8c84203de246 | [
"Apache-2.0"
] | 767 | 2019-03-25T06:35:43.000Z | 2022-03-30T08:57:51.000Z | paas-ce/paas/esb/components/bk/apisv2/bk_paas/create_app.py | renmcc/bk-PaaS | 1c9e4e9cfb40fc3375cd6b5f08af8c84203de246 | [
"Apache-2.0"
] | 194 | 2019-03-29T07:16:41.000Z | 2022-03-30T06:17:49.000Z | paas-ce/paas/esb/components/bk/apisv2/bk_paas/create_app.py | renmcc/bk-PaaS | 1c9e4e9cfb40fc3375cd6b5f08af8c84203de246 | [
"Apache-2.0"
] | 381 | 2019-03-25T07:19:54.000Z | 2022-03-29T03:22:42.000Z | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 36.62963 | 305 | 0.566734 | import json
from django import forms
from components.component import Component
from common.forms import BaseComponentForm, ListField
from common.constants import API_TYPE_OP
from .toolkit import tools, configs
class CreateApp(Component):
sys_name = configs.SYSTEM_NAME
api_type = API_TYPE_OP
host = c... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.