max_stars_repo_path
stringlengths
4
286
max_stars_repo_name
stringlengths
5
119
max_stars_count
int64
0
191k
id
stringlengths
1
7
content
stringlengths
6
1.03M
content_cleaned
stringlengths
6
1.03M
language
stringclasses
111 values
language_score
float64
0.03
1
comments
stringlengths
0
556k
edu_score
float64
0.32
5.03
edu_int_score
int64
0
5
tools/nntool/expressions/symbolic/q15_quantization/scale_quantized.py
GreenWaves-Technologies/gap_sdk
118
6625451
<gh_stars>100-1000 # Copyright (C) 2020 GreenWaves Technologies, SAS # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later ver...
# Copyright (C) 2020 GreenWaves Technologies, SAS # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # This progr...
en
0.873184
# Copyright (C) 2020 GreenWaves Technologies, SAS # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # This program...
1.884991
2
dephell/commands/self_autocomplete.py
Brishen/dephell
0
6625452
<filename>dephell/commands/self_autocomplete.py # built-in import os from argparse import ArgumentParser from pathlib import Path from platform import platform # external from dephell_shells import Shells # app from ..actions import make_bash_autocomplete, make_zsh_autocomplete from ..config import builders, get_data...
<filename>dephell/commands/self_autocomplete.py # built-in import os from argparse import ArgumentParser from pathlib import Path from platform import platform # external from dephell_shells import Shells # app from ..actions import make_bash_autocomplete, make_zsh_autocomplete from ..config import builders, get_data...
en
0.878202
# built-in # external # app Enable DepHell commands autocomplete for current shell. # Install completions to the correct location for modern bash-completion. # This will be sourced on-demand by bash-completion as soon as dephell is # completed for the first time. # https://github.com/dephell/dephell/pull/132 # https://...
2.321889
2
membership/management/commands/paper_reminders.py
str4nd/sikteeri
22
6625453
# encoding: UTF-8 import logging from tempfile import NamedTemporaryFile from django.core.management.base import BaseCommand, CommandError from membership.models import BillingCycle logger = logging.getLogger("paper_reminders") class Command(BaseCommand): help = 'Create paper reminders pdf' def add_argume...
# encoding: UTF-8 import logging from tempfile import NamedTemporaryFile from django.core.management.base import BaseCommand, CommandError from membership.models import BillingCycle logger = logging.getLogger("paper_reminders") class Command(BaseCommand): help = 'Create paper reminders pdf' def add_argume...
en
0.156115
# encoding: UTF-8
2.163673
2
simtool/encode.py
hubzero/simtool
0
6625454
# @package hubzero-simtool # @file encode.py # @copyright Copyright (c) 2019-2021 The Regents of the University of California. # @license http://opensource.org/licenses/MIT MIT # @trademark HUBzero is a registered trademark of The Regents of the University of California. # import jsonpickle # T...
# @package hubzero-simtool # @file encode.py # @copyright Copyright (c) 2019-2021 The Regents of the University of California. # @license http://opensource.org/licenses/MIT MIT # @trademark HUBzero is a registered trademark of The Regents of the University of California. # import jsonpickle # T...
en
0.816663
# @package hubzero-simtool # @file encode.py # @copyright Copyright (c) 2019-2021 The Regents of the University of California. # @license http://opensource.org/licenses/MIT MIT # @trademark HUBzero is a registered trademark of The Regents of the University of California. # # The purpose of this ...
2.549614
3
neo/test/iotest/test_tdtio.py
neurodebian/python-neo
1
6625455
<filename>neo/test/iotest/test_tdtio.py<gh_stars>1-10 # encoding: utf-8 """ Tests of io.tdtio """ from __future__ import absolute_import, division try: import unittest2 as unittest except ImportError: import unittest from ...io import TdtIO import numpy from .common_io_test import BaseTestIO class Test...
<filename>neo/test/iotest/test_tdtio.py<gh_stars>1-10 # encoding: utf-8 """ Tests of io.tdtio """ from __future__ import absolute_import, division try: import unittest2 as unittest except ImportError: import unittest from ...io import TdtIO import numpy from .common_io_test import BaseTestIO class Test...
ja
0.240858
# encoding: utf-8 Tests of io.tdtio #~ 'aep_05/Block-2/aep_05_Block-2.Tbk', #~ 'aep_05/Block-2/aep_05_Block-2.Tdx', #~ 'aep_05/Block-2/aep_05_Block-2.tev', #~ 'aep_05/Block-2/aep_05_Block-2.tsq', #~ 'aep_05/Block-3/aep_05_Block-3.Tbk', #~ 'aep_05/Block-3/aep_05_Block-3.Tdx', #~ 'aep_05/Block-3/aep_05_Block-3.tev', #~ '...
2.228716
2
pynucastro/nucdata/AtomicMassEvaluation/extract_mass_excess.py
pyreaclib/pyreaclib
6
6625456
<reponame>pyreaclib/pyreaclib import argparse """ This module extract the (A,Z, dm) tuples from `nubase_3.mas20.txt`, where: :var A: is the atomic weight measured in atomic mass units. :var Z: is the atomic number. :var dm: is the mass difference A_{nuc}-A. """ #os.path.dirname(os.path.realpath(__file__)) parser = ...
import argparse """ This module extract the (A,Z, dm) tuples from `nubase_3.mas20.txt`, where: :var A: is the atomic weight measured in atomic mass units. :var Z: is the atomic number. :var dm: is the mass difference A_{nuc}-A. """ #os.path.dirname(os.path.realpath(__file__)) parser = argparse.ArgumentParser() pars...
en
0.676626
This module extract the (A,Z, dm) tuples from `nubase_3.mas20.txt`, where: :var A: is the atomic weight measured in atomic mass units. :var Z: is the atomic number. :var dm: is the mass difference A_{nuc}-A. #os.path.dirname(os.path.realpath(__file__)) #dm is measured in keV, but we want MeV
3.037997
3
tobiko/tests/functional/openstack/test_neutron.py
FedericoRessi/tobiko
1
6625457
<gh_stars>1-10 # Copyright (c) 2019 Red Hat, 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 # # ...
# Copyright (c) 2019 Red Hat, 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 requi...
en
0.885671
# Copyright (c) 2019 Red Hat, 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 requi...
1.747115
2
_1327/documents/views.py
fsr-itse/1327
10
6625458
from datetime import datetime import json import os from asgiref.sync import async_to_sync import channels.layers from django.contrib import messages from django.contrib.admin.utils import NestedObjects from django.contrib.auth.models import Group from django.contrib.contenttypes.models import ContentType from django...
from datetime import datetime import json import os from asgiref.sync import async_to_sync import channels.layers from django.contrib import messages from django.contrib.admin.utils import NestedObjects from django.contrib.auth.models import Group from django.contrib.contenttypes.models import ContentType from django...
en
0.933632
# noqa # noqa # noqa # page is not new and has no permissions set, it is likely that somebody tries to view an autosaved page # users are only allowed to view autosaved pages if they have the "add" permission for documents # if the edit form has a formset we will initialize it here # find the we want to revert to # use...
1.454351
1
datadog_checks_dev/datadog_checks/dev/tooling/commands/validate/eula.py
kjmadscience/integrations-core
0
6625459
<gh_stars>0 # (C) Datadog, Inc. 2020-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import click from ...manifest_utils import Manifest from ...testing import process_checks_option from ...utils import complete_valid_checks, get_manifest_file from ..console import CONTEXT_SET...
# (C) Datadog, Inc. 2020-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import click from ...manifest_utils import Manifest from ...testing import process_checks_option from ...utils import complete_valid_checks, get_manifest_file from ..console import CONTEXT_SETTINGS, abort...
en
0.65925
# (C) Datadog, Inc. 2020-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) Validate all EULA definition files. If `check` is specified, only the check will be validated, if check value is 'changed' will only apply to changed checks, an 'all' or empty `check` value will v...
1.994231
2
clustering_normalized_cuts/networks.py
shaun95/google-research
1
6625460
<filename>clustering_normalized_cuts/networks.py # coding=utf-8 # Copyright 2022 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/lic...
<filename>clustering_normalized_cuts/networks.py # coding=utf-8 # Copyright 2022 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/lic...
en
0.749142
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
2.034697
2
src/exabgp/bgp/message/update/attribute/aigp.py
ahmet2mir/exabgp
27
6625461
<gh_stars>10-100 # encoding: utf-8 """ aigp.py Created by <NAME> on 2013-09-24. Copyright (c) 2009-2017 Exa Networks. All rights reserved. License: 3-clause BSD. (See the COPYRIGHT file) """ from struct import pack from struct import unpack from exabgp.bgp.message.update.attribute.attribute import Attribute # ====...
# encoding: utf-8 """ aigp.py Created by <NAME> on 2013-09-24. Copyright (c) 2009-2017 Exa Networks. All rights reserved. License: 3-clause BSD. (See the COPYRIGHT file) """ from struct import pack from struct import unpack from exabgp.bgp.message.update.attribute.attribute import Attribute # =====================...
en
0.297743
# encoding: utf-8 aigp.py Created by <NAME> on 2013-09-24. Copyright (c) 2009-2017 Exa Networks. All rights reserved. License: 3-clause BSD. (See the COPYRIGHT file) # ========================================================================== TLV # # 0 1 2 3 # 0 1 ...
2.471115
2
imgtag/main_window.py
pauljxtan/imgtag
0
6625462
<filename>imgtag/main_window.py<gh_stars>0 """Provides the top-level window widget.""" from PySide2.QtWidgets import QAction, QApplication, QMainWindow, QTabWidget from .state import GlobalState from .tabs import FileTab, GalleryTab class MainWindow(QMainWindow): """The top-level window.""" title = 'ImgTag'...
<filename>imgtag/main_window.py<gh_stars>0 """Provides the top-level window widget.""" from PySide2.QtWidgets import QAction, QApplication, QMainWindow, QTabWidget from .state import GlobalState from .tabs import FileTab, GalleryTab class MainWindow(QMainWindow): """The top-level window.""" title = 'ImgTag'...
en
0.811584
Provides the top-level window widget. The top-level window.
2.447633
2
lena/core/functions.py
ynikitenko/lena
4
6625463
import sys def flow_to_iter(flow): """Convert *flow* to support both ``__iter__`` and ``next``. *flow* must be iterable. If that doesn't support ``next`` (for example, a list), it will be converted to *iter(flow)*. Works for Python versions 2 and 3 (where next is different). """ if (...
import sys def flow_to_iter(flow): """Convert *flow* to support both ``__iter__`` and ``next``. *flow* must be iterable. If that doesn't support ``next`` (for example, a list), it will be converted to *iter(flow)*. Works for Python versions 2 and 3 (where next is different). """ if (...
en
0.889569
Convert *flow* to support both ``__iter__`` and ``next``. *flow* must be iterable. If that doesn't support ``next`` (for example, a list), it will be converted to *iter(flow)*. Works for Python versions 2 and 3 (where next is different).
3.402405
3
tests/test_static_content.py
grihabor/catch-hook-telegram-bot
0
6625464
import pytest @pytest.mark.parametrize('mapping,json_obj,expected', [ ({}, {}, {}), ({'name': 'obj.name'}, {'obj': {'name': 'John'}}, {'name': 'John'}), ({ 'user': { 'id': 'project.user_id', 'name': 'project.user_name' }, 'name': 'project.name' }, ...
import pytest @pytest.mark.parametrize('mapping,json_obj,expected', [ ({}, {}, {}), ({'name': 'obj.name'}, {'obj': {'name': 'John'}}, {'name': 'John'}), ({ 'user': { 'id': 'project.user_id', 'name': 'project.user_name' }, 'name': 'project.name' }, ...
none
1
2.379223
2
tools/conllu-w2t.py
coastalcph/HIT-SCIR-CoNLL2019
5
6625465
#!/usr/bin/env python import sys import re import file_util from file_util import ID,HEAD,DEPS #column index for the columns we'll need import argparse interval_re=re.compile(ur"^([0-9]+)-([0-9]+)$",re.U) def get_tokens(wtree): """ Returns a list of tokens in the tree as integer intervals like so: [(1,1),...
#!/usr/bin/env python import sys import re import file_util from file_util import ID,HEAD,DEPS #column index for the columns we'll need import argparse interval_re=re.compile(ur"^([0-9]+)-([0-9]+)$",re.U) def get_tokens(wtree): """ Returns a list of tokens in the tree as integer intervals like so: [(1,1),...
en
0.891056
#!/usr/bin/env python #column index for the columns we'll need Returns a list of tokens in the tree as integer intervals like so: [(1,1),(2,3),(4,4),...] `tree` is a tree (as produced by trees()) in the word-indexed format #Not covered by the previous interval? #nope - let's make a default interval for it #Che...
3.341522
3
src/mdp/markov_decision_procedure.py
Gnosling/RLASP
0
6625466
import os import clingo import random from typing import Set, List class MarkovDecisionProcedure: @staticmethod def file_path(file_name): return os.path.join(os.path.dirname(os.path.abspath(__file__)), file_name) def __init__(self, state_initial: Set[str], state_static: Set[str], discount_rate: ...
import os import clingo import random from typing import Set, List class MarkovDecisionProcedure: @staticmethod def file_path(file_name): return os.path.join(os.path.dirname(os.path.abspath(__file__)), file_name) def __init__(self, state_initial: Set[str], state_static: Set[str], discount_rate: ...
en
0.805962
# TODO: Needs to be separated from abstract MDP. -> Do it when introducing a second MDP # MDP trajectory: S0, A0, R1, S1, A1, R2, S2, A2, ... # S0 #A0 will be given later once the first action is executed # R0, which is undefined # self.available_actions = self._compute_available_actions # ˙Atom is of the form `state(f...
2.862174
3
src/twisted/internet/endpoints.py
muelli/twisted
0
6625467
<reponame>muelli/twisted # -*- test-case-name: twisted.internet.test.test_endpoints -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Implementations of L{IStreamServerEndpoint} and L{IStreamClientEndpoint} that wrap the L{IReactorTCP}, L{IReactorSSL}, and L{IReactorUNIX} interfaces. Thi...
# -*- test-case-name: twisted.internet.test.test_endpoints -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Implementations of L{IStreamServerEndpoint} and L{IStreamClientEndpoint} that wrap the L{IReactorTCP}, L{IReactorSSL}, and L{IReactorUNIX} interfaces. This also implements an exte...
en
0.685007
# -*- test-case-name: twisted.internet.test.test_endpoints -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. Implementations of L{IStreamServerEndpoint} and L{IStreamClientEndpoint} that wrap the L{IReactorTCP}, L{IReactorSSL}, and L{IReactorUNIX} interfaces. This also implements an extensibl...
1.851418
2
color_see.py
Amenoimi/Simple_OCR
0
6625468
from PIL import Image import numpy as np import cv2 class color_see(): def pick_color(self,event,x,y,flags,param): if event == cv2.EVENT_LBUTTONDOWN: self.pixel = self.frame[y,x] #you might want to adjust the ranges(+-10, etc): self.upper = np.array([ self.pixel[0] + 20, self.pixel[1] + 20, ...
from PIL import Image import numpy as np import cv2 class color_see(): def pick_color(self,event,x,y,flags,param): if event == cv2.EVENT_LBUTTONDOWN: self.pixel = self.frame[y,x] #you might want to adjust the ranges(+-10, etc): self.upper = np.array([ self.pixel[0] + 20, self.pixel[1] + 20, ...
en
0.42
#you might want to adjust the ranges(+-10, etc): # mouse callback function # 選擇第二隻攝影機 # 從攝影機擷取一張影像 # find contours in the image # compute the (rotated) bounding box around then # contour and then draw it # 顯示圖片 # 釋放攝影機 # 關閉所有 OpenCV 視窗
2.99187
3
10_days_of_statistics_5_2.py
sercangul/HackerRank
0
6625469
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jun 3 19:19:34 2019 @author: sercangul """ a, b = map(float, input().split()) print (round(160+40*(a**2 + a),3)) print (round(128+40*(b**2 + b),3))
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jun 3 19:19:34 2019 @author: sercangul """ a, b = map(float, input().split()) print (round(160+40*(a**2 + a),3)) print (round(128+40*(b**2 + b),3))
en
0.400077
#!/usr/bin/env python3 # -*- coding: utf-8 -*- Created on Mon Jun 3 19:19:34 2019 @author: sercangul
3.193033
3
start.py
RaghuA06/Platformer-Game-using-PyGame
0
6625470
<reponame>RaghuA06/Platformer-Game-using-PyGame def intro_screen(): background = pygame.Surface(size) background = background.convert() background = pygame.image.load("startscreen.jpg") gray = (140,140,145) light_gray = (190,190,200) white = (255,255,255) button1 = pygame.Re...
def intro_screen(): background = pygame.Surface(size) background = background.convert() background = pygame.image.load("startscreen.jpg") gray = (140,140,145) light_gray = (190,190,200) white = (255,255,255) button1 = pygame.Rect(100,100,150,25) button2 = pygame.Rect(100,20...
ru
0.417693
#print("Play")
3.312525
3
src/config/common/vnc_cassandra.py
codilime/contrail-controller-arch
0
6625471
<filename>src/config/common/vnc_cassandra.py # # Copyright (c) 2014 Juniper Networks, Inc. All rights reserved. # import pycassa from pycassa import ColumnFamily from pycassa.batch import Mutator from pycassa.system_manager import SystemManager, SIMPLE_STRATEGY from pycassa.pool import AllServersUnavailable, MaximumRe...
<filename>src/config/common/vnc_cassandra.py # # Copyright (c) 2014 Juniper Networks, Inc. All rights reserved. # import pycassa from pycassa import ColumnFamily from pycassa.batch import Mutator from pycassa.system_manager import SystemManager, SIMPLE_STRATEGY from pycassa.pool import AllServersUnavailable, MaximumRe...
en
0.635883
# # Copyright (c) 2014 Juniper Networks, Inc. All rights reserved. # # Name to ID mapping keyspace + tables # TODO describe layout # TODO describe layout # key: object type, column ($type:$id, uuid) # where type is entity object is being shared with. Project initially # end get_db_info # if no generate_url is specified...
1.801456
2
worker.py
chrononyan/ok
148
6625472
#!/usr/bin/env python3 import os from flask_rq import get_worker from raven import Client from raven.transport.http import HTTPTransport from rq.contrib.sentry import register_sentry from server import create_app if __name__ == '__main__': # default to dev config env = os.getenv('OK_ENV', 'dev') app = cr...
#!/usr/bin/env python3 import os from flask_rq import get_worker from raven import Client from raven.transport.http import HTTPTransport from rq.contrib.sentry import register_sentry from server import create_app if __name__ == '__main__': # default to dev config env = os.getenv('OK_ENV', 'dev') app = cr...
en
0.590113
#!/usr/bin/env python3 # default to dev config # disable sentry for now (causes worker CrashLoopBackOff in kubernetes) # register_sentry(client, worker)
1.888609
2
front-end/testsuite-python-lib/Python-3.3.0/Lib/site.py
MalloyPower/parsing-python
1
6625473
"""Append module search paths for third-party packages to sys.path. **************************************************************** * This module is automatically imported during initialization. * **************************************************************** This will append site-specific paths to the module sear...
"""Append module search paths for third-party packages to sys.path. **************************************************************** * This module is automatically imported during initialization. * **************************************************************** This will append site-specific paths to the module sear...
en
0.855353
Append module search paths for third-party packages to sys.path. **************************************************************** * This module is automatically imported during initialization. * **************************************************************** This will append site-specific paths to the module search ...
2.42229
2
texar/data/data/dataset_utils_test.py
Holmeswww/Text_Infilling
87
6625474
# -*- coding: utf-8 -*- # """ Unit tests for data utils. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import numpy as np import tensorflow as tf from texar.data.data import dataset_utils as dsutils # pylint...
# -*- coding: utf-8 -*- # """ Unit tests for data utils. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import numpy as np import tensorflow as tf from texar.data.data import dataset_utils as dsutils # pylint...
en
0.560208
# -*- coding: utf-8 -*- # Unit tests for data utils. # pylint: disable=invalid-name Tests various transformation utilities. Tests :func:`texar.data.make_chained_transformation`
2.611157
3
igtodiscordhook/imaging.py
hrmorley34/igtodiscordhook
0
6625475
<filename>igtodiscordhook/imaging.py import math from os import fdopen from pathlib import Path from PIL import Image from tempfile import mkstemp from typing import Iterable, List EXPORT_SUFFIX = ".png" def load(path: Path) -> Image.Image: return Image.open(path) def save(dir: Path, im: Image.Image) -> Path:...
<filename>igtodiscordhook/imaging.py import math from os import fdopen from pathlib import Path from PIL import Image from tempfile import mkstemp from typing import Iterable, List EXPORT_SUFFIX = ".png" def load(path: Path) -> Image.Image: return Image.open(path) def save(dir: Path, im: Image.Image) -> Path:...
en
0.324093
# elif abs(im.size[1] / im.size[0] - size[1] / size[0]) < 0.001: # # same ratio, so just resize # resized = im.resize(size, Image.BICUBIC)
2.856111
3
solutions/101.symmetric-tree.240649552.ac.py
satu0king/Leetcode-Solutions
78
6625476
<filename>solutions/101.symmetric-tree.240649552.ac.py<gh_stars>10-100 # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def isSymmetric(self, root: TreeNode) -> bool: ...
<filename>solutions/101.symmetric-tree.240649552.ac.py<gh_stars>10-100 # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def isSymmetric(self, root: TreeNode) -> bool: ...
en
0.60307
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None
3.836682
4
coca/utils/optim.py
CISiPLab/cisip-GreenCap
12
6625477
# -*- coding: utf-8 -*- """ Created on 16 Sep 2020 15:01:35 @author: jiahuei """ import logging import math import torch from torch import optim logger = logging.getLogger(__name__) # noinspection PyAttributeOutsideInit class RateOpt: """Optim wrapper that implements rate.""" def step(self, step=None, epoch...
# -*- coding: utf-8 -*- """ Created on 16 Sep 2020 15:01:35 @author: jiahuei """ import logging import math import torch from torch import optim logger = logging.getLogger(__name__) # noinspection PyAttributeOutsideInit class RateOpt: """Optim wrapper that implements rate.""" def step(self, step=None, epoch...
en
0.368122
# -*- coding: utf-8 -*- Created on 16 Sep 2020 15:01:35 @author: jiahuei # noinspection PyAttributeOutsideInit Optim wrapper that implements rate. Update parameters and rate Optim wrapper that implements rate. Implement `lrate` above Optim wrapper that implements rate. Implement `lrate` above # Assign the learning rate...
2.417036
2
home/urls.py
ASAM-DevProject/p24
0
6625478
from django.urls import path from home.views import home, error_access_permission_dr, error_access_permission_sick app_name = 'home' urlpatterns = [ path('', home, name='home'), path('permission/sick', error_access_permission_sick, name='permission_sick'), path('permission/dr', error_access_permission_d...
from django.urls import path from home.views import home, error_access_permission_dr, error_access_permission_sick app_name = 'home' urlpatterns = [ path('', home, name='home'), path('permission/sick', error_access_permission_sick, name='permission_sick'), path('permission/dr', error_access_permission_d...
none
1
1.663661
2
selection/dbms/hana_dbms.py
penggan666/index_selection_evaluation
37
6625479
import json import logging import re import subprocess import time import pyhdb from ..database_connector import DatabaseConnector class HanaDatabaseConnector(DatabaseConnector): def __init__(self, db_name, autocommit=False): DatabaseConnector.__init__(self, db_name, autocommit=autocommit) self....
import json import logging import re import subprocess import time import pyhdb from ..database_connector import DatabaseConnector class HanaDatabaseConnector(DatabaseConnector): def __init__(self, db_name, autocommit=False): DatabaseConnector.__init__(self, db_name, autocommit=autocommit) self....
en
0.60727
# `db_name` is the schema name # TODO 'tpch' / 'tpcds' custom rules # TODO pass scp output to logger # pdb returns this even if the explain statement worked # TODO store result in dictionary-like format # TODO how to get cost when simulating indexes # TODO implement # TODO update index.estimated_size
2.176155
2
api/draft_registrations/views.py
tsukaeru/RDM-osf.io
11
6625480
from rest_framework import permissions as drf_permissions, exceptions from framework.auth.oauth_scopes import CoreScopes from api.base import permissions as base_permissions from api.base.pagination import DraftRegistrationContributorPagination from api.draft_registrations.permissions import ( DraftContributorDet...
from rest_framework import permissions as drf_permissions, exceptions from framework.auth.oauth_scopes import CoreScopes from api.base import permissions as base_permissions from api.base.pagination import DraftRegistrationContributorPagination from api.draft_registrations.permissions import ( DraftContributorDet...
en
0.773921
Old DraftMixin was built under the assumption that a node was provided from the start. All permission checking went through the node, not the draft. New draft registration endpoints do permission checking on the draft registration. # Overrides DraftMixin # We do not have to check the branched_from relationship....
1.933683
2
parse_lnk.py
cccs-rs/assemblyline-service-characterize
1
6625481
import struct from assemblyline.common.str_utils import safe_str LinkFlags_def = ['HasLinkTargetIDList', 'HasLinkInfo', 'HasName', 'HasRelativePath', 'HasWorkingDir', 'HasArguments', 'HasIconLocation', ...
import struct from assemblyline.common.str_utils import safe_str LinkFlags_def = ['HasLinkTargetIDList', 'HasLinkInfo', 'HasName', 'HasRelativePath', 'HasWorkingDir', 'HasArguments', 'HasIconLocation', ...
en
0.972905
See MS-SHLLINK # The spec doesn't give a clear indication of why this is needed. # So I've made it optional and disabled by default. # String data # Note: there is technically an "ExtraData" block after the strings. # But I couldn't find anything in them that was worth parsing out. # Not enough bytes in the file
1.437974
1
src/harness/reference_models/tools/examples/fss_pointing_test.py
NSF-Swift/Spectrum-Access-System
58
6625482
# Copyright 2017 SAS Project 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 requ...
# Copyright 2017 SAS Project 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 requ...
en
0.810415
# Copyright 2017 SAS Project 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 requ...
1.611472
2
tests/small/test_forge.py
durandj/mymcadmin
0
6625483
""" Tests for the Forge related functions """ import os import os.path import unittest import unittest.mock import nose import requests from mymcadmin.errors import ForgeError from mymcadmin.forge import ( get_forge_for_mc_version, get_forge_mc_versions, get_forge_version, ) class TestForge(unittest.Tes...
""" Tests for the Forge related functions """ import os import os.path import unittest import unittest.mock import nose import requests from mymcadmin.errors import ForgeError from mymcadmin.forge import ( get_forge_for_mc_version, get_forge_mc_versions, get_forge_version, ) class TestForge(unittest.Tes...
en
0.487434
Tests for the Forge related functions Tests for the Forge related functions Tests that we can retrieve a list of all the MC versions Forge supports <html> <body> <div class="versions"> <ul class="links"> <li class="li-version-list"> <span>1.8</span> <div class="versions-info"> ...
2.536054
3
dataset_scripts/voc/create_annotations_voc.py
AlbertoSabater/Keras-YOLO-v3
7
6625484
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Mar 26 15:09:26 2019 @author: asabater """ import os from tqdm import tqdm import xml.etree.ElementTree import random classes = ["aeroplane", "bicycle", "bird", "boat", "bottle", "bus", "car", "cat", "chair", "cow", "diningtable", "dog", ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Mar 26 15:09:26 2019 @author: asabater """ import os from tqdm import tqdm import xml.etree.ElementTree import random classes = ["aeroplane", "bicycle", "bird", "boat", "bottle", "bus", "car", "cat", "chair", "cow", "diningtable", "dog", ...
en
0.471523
#!/usr/bin/env python3 # -*- coding: utf-8 -*- Created on Tue Mar 26 15:09:26 2019 @author: asabater # %% #annotations_train = [] #annotations_val = [] # with open('/mnt/hdd/datasets/VOC/{}_train.txt'.format(voc_set)) as f: # frames_train = [ '/'.join(l.split('/')[-4:]) for l in f.read().splitlines() ] # ...
2.27064
2
slotting/forms.py
uofllodi/warehousingtools
0
6625485
<reponame>uofllodi/warehousingtools<filename>slotting/forms.py from django import forms from django.core.exceptions import ValidationError from django.utils.translation import gettext_lazy as _ import numpy as np from django.utils.safestring import mark_safe import certifi import urllib3 from botocore.client import Con...
from django import forms from django.core.exceptions import ValidationError from django.utils.translation import gettext_lazy as _ import numpy as np from django.utils.safestring import mark_safe import certifi import urllib3 from botocore.client import Config import boto3 from django.conf import settings def read_ar...
en
0.81421
# delete file #validators = [validators.validate_hs]) #delete_file(urlname) #delete_file(urlname)
1.964337
2
pages/intentpreview_test.py
rakuco/chromium-dashboard
1
6625486
<gh_stars>1-10 # Copyright 2020 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License") # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
# Copyright 2020 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License") # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
en
0.842338
# Copyright 2020 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License") # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
2.026979
2
saleor/graphql/package/schema.py
nlkhagva/saleor
0
6625487
import graphene from ..core.fields import FilterInputConnectionField from .bulk_mutations import GaduurBulkDelete, PackageBulkDelete, PackageBulkUstatus, PackageLineBulkDelete from .mutations import GaduurCreate, GaduurDelete, GaduurUpdate, PackageCreate, PackageDelete, PackageUpdate, PackageLineDelete from .resolvers ...
import graphene from ..core.fields import FilterInputConnectionField from .bulk_mutations import GaduurBulkDelete, PackageBulkDelete, PackageBulkUstatus, PackageLineBulkDelete from .mutations import GaduurCreate, GaduurDelete, GaduurUpdate, PackageCreate, PackageDelete, PackageUpdate, PackageLineDelete from .resolvers ...
en
0.493878
##################### #### gaduur dagavar ################################### # PACKAGES # class FlineCustom(CountableDjangoObjectType): # order_id = graphene.Int() # checked = graphene.Boolean() # class Meta: # description = "Represents line of the fulfillment." # interfaces = [graphene.re...
2.211454
2
mpds_aiida/common.py
mpds-io/mpds-aiida
2
6625488
import os import json from collections import namedtuple import yaml from ase.data import chemical_symbols from aiida_crystal_dft.io.d12 import D12 from aiida_crystal_dft.io.basis import BasisFile # NB only used to determine ecp from mpds_client import APIError from mpds_aiida import TEMPLATE_DIR verbatim_basis =...
import os import json from collections import namedtuple import yaml from ase.data import chemical_symbols from aiida_crystal_dft.io.d12 import D12 from aiida_crystal_dft.io.basis import BasisFile # NB only used to determine ecp from mpds_client import APIError from mpds_aiida import TEMPLATE_DIR verbatim_basis =...
en
0.6785
# NB only used to determine ecp Make an educated guess of the metallic compound character, returns bool Keeps all available BS in a dict for convenience NB. we assume BS repo_dir = AiiDA's *basis_family* Templates present the permanent calc setup # assert 'parameters' in calc and 'crystal' in calc['parameters']...
2.24616
2
language-modeling/fast_transformers/__init__.py
minhtannguyen/transformer-mgk
5
6625489
<reponame>minhtannguyen/transformer-mgk<filename>language-modeling/fast_transformers/__init__.py<gh_stars>1-10 """Provide a library with fast transformer implementations.""" __author__ = "" __copyright__ = "" __license__ = "MIT" __maintainer__ = "" __email__ = "" __url__ = "https://github.com/idiap/fast-transformers" ...
"""Provide a library with fast transformer implementations.""" __author__ = "" __copyright__ = "" __license__ = "MIT" __maintainer__ = "" __email__ = "" __url__ = "https://github.com/idiap/fast-transformers" __version__ = "0.4.0"
en
0.81628
Provide a library with fast transformer implementations.
1.022413
1
bundle_cache/app_store/tk-flame-export/v1.9.1/python/dialogs/summary_dialog.py
ColinKennedy/tk-config-default2-respawn
4
6625490
<filename>bundle_cache/app_store/tk-flame-export/v1.9.1/python/dialogs/summary_dialog.py # Copyright (c) 2014 Shotgun Software Inc. # # CONFIDENTIAL AND PROPRIETARY # # This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit # Source Code License included in this distribution package. See LICENSE. ...
<filename>bundle_cache/app_store/tk-flame-export/v1.9.1/python/dialogs/summary_dialog.py # Copyright (c) 2014 Shotgun Software Inc. # # CONFIDENTIAL AND PROPRIETARY # # This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit # Source Code License included in this distribution package. See LICENSE. ...
en
0.895716
# Copyright (c) 2014 Shotgun Software Inc. # # CONFIDENTIAL AND PROPRIETARY # # This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit # Source Code License included in this distribution package. See LICENSE. # By accessing, using, copying or modifying this work you indicate your # agreement to the S...
2.003612
2
abc192/d.py
nishio/atcoder
1
6625491
<filename>abc192/d.py # included from snippets/main.py def debug(*x, msg=""): import sys print(msg, *x, file=sys.stderr) def lessEqual(s, base, limit): ret = 0 for c in s: ret *= base ret += int(c) if limit < ret: return False return True def solve(X, M): ...
<filename>abc192/d.py # included from snippets/main.py def debug(*x, msg=""): import sys print(msg, *x, file=sys.stderr) def lessEqual(s, base, limit): ret = 0 for c in s: ret *= base ret += int(c) if limit < ret: return False return True def solve(X, M): ...
en
0.530997
# included from snippets/main.py # (1) # tests 22 10 >>> as_input(T1) >>> main() 2 999 1500 >>> as_input(T2) >>> main() 3 100000000000000000000000000000000000000000000000000000000000 1000000000000000000 >>> as_input(T3) >>> main() 1 2 1 >>> as_input(T4) >>> main() 0 1 2 >>> as_input(T5) >>> main() 1 10 1000 >>> as_inpu...
3.23576
3
WeBlog/posts/views.py
Harshad347/WeBlog
0
6625492
from django.shortcuts import render, redirect, get_object_or_404 from .models import Post from comments.models import Comment # from accounts.models import Profile from .forms import PostForm from comments.forms import CommentForm from django.contrib import messages from django.views.generic import FormView, UpdateView...
from django.shortcuts import render, redirect, get_object_or_404 from .models import Post from comments.models import Comment # from accounts.models import Profile from .forms import PostForm from comments.forms import CommentForm from django.contrib import messages from django.views.generic import FormView, UpdateView...
en
0.404713
# from accounts.models import Profile # profile = Profile.objects.get(user=request.user) # 'profile': profile, # profile = Profile.objects.get(user=request.user) # 'profile': profile,
2.150557
2
dreamhostapi/module.py
mcgid/python-dreamhostapi
8
6625493
<gh_stars>1-10 from dreamhostapi.exceptions import APIError class Module(object): def __init__(self, name, call_function): self._name = name self._no_such_commands = [] self._call = call_function def __getattr__(self, method_name): if method_name.startswith('__'): ...
from dreamhostapi.exceptions import APIError class Module(object): def __init__(self, name, call_function): self._name = name self._no_such_commands = [] self._call = call_function def __getattr__(self, method_name): if method_name.startswith('__'): raise Attribute...
none
1
2.56306
3
pink/constants.py
Fogapod/pink
0
6625494
import os from dotenv import load_dotenv load_dotenv() PREFIX = os.environ["BOT_PREFIX"]
import os from dotenv import load_dotenv load_dotenv() PREFIX = os.environ["BOT_PREFIX"]
none
1
1.518213
2
frozen_dir.py
oneincloud/xyft_strategy2_py3.5.3
0
6625495
<reponame>oneincloud/xyft_strategy2_py3.5.3<gh_stars>0 import sys import os def app_path(): ''' Return the base application path. :return: ''' if hasattr(sys,'frozen'): # Handle PyInstaller return os.path.dirname(sys.executable) return os.path.dirname(__file__) #生成资源文件目录访问路径 de...
import sys import os def app_path(): ''' Return the base application path. :return: ''' if hasattr(sys,'frozen'): # Handle PyInstaller return os.path.dirname(sys.executable) return os.path.dirname(__file__) #生成资源文件目录访问路径 def resource_path(): if getattr(sys, 'frozen', False)...
en
0.288853
Return the base application path. :return: # Handle PyInstaller #生成资源文件目录访问路径 #是否Bundle Resource # return os.path.join(base_path, relative_path)
2.483233
2
code/import_classes_example.py
gatoravi/python_chennai_jul2016
0
6625496
from classes import * def main(): s1 = Shape("red") t1 = Triangle("blue") t1.color_function() t2 = Triangle("green") t2.color_function() t2.myshape() main()
from classes import * def main(): s1 = Shape("red") t1 = Triangle("blue") t1.color_function() t2 = Triangle("green") t2.color_function() t2.myshape() main()
none
1
2.823967
3
12_Nguyen_Lam_Manh_Tuyen/1.6.py
lpython2006e/exercies
0
6625497
#Write a guessing game where the user has to guess a secret number. # After every guess the program tells the user whether their number was too large or too small. # At the end the number of tries needed should be printed. # It counts only as one try if they input the same number multiple times consecutively. import ra...
#Write a guessing game where the user has to guess a secret number. # After every guess the program tells the user whether their number was too large or too small. # At the end the number of tries needed should be printed. # It counts only as one try if they input the same number multiple times consecutively. import ra...
en
0.96838
#Write a guessing game where the user has to guess a secret number. # After every guess the program tells the user whether their number was too large or too small. # At the end the number of tries needed should be printed. # It counts only as one try if they input the same number multiple times consecutively. #count ti...
4.108098
4
certbot/tests/helpful_test.py
vivithemage/certbot
16,789
6625498
<reponame>vivithemage/certbot<gh_stars>1000+ """Tests for certbot.helpful_parser""" import unittest try: import mock except ImportError: # pragma: no cover from unittest import mock from certbot import errors from certbot._internal.cli import HelpfulArgumentParser from certbot._internal.cli import _DomainsAct...
"""Tests for certbot.helpful_parser""" import unittest try: import mock except ImportError: # pragma: no cover from unittest import mock from certbot import errors from certbot._internal.cli import HelpfulArgumentParser from certbot._internal.cli import _DomainsAction from certbot._internal import constants ...
en
0.799785
Tests for certbot.helpful_parser # pragma: no cover Test the prescan_for_flag method of HelpfulArgumentParser Tests for determine_verb methods of HelpfulArgumentParser Tests for add method in HelpfulArgumentParser Test add_group method of HelpfulArgumentParser # The user request help on run. A topic that given somewher...
2.730441
3
abeja/training/api/client.py
abeja-inc/abeja-platform-sdk
2
6625499
import json import tempfile import zipfile from io import BytesIO from pathlib import Path from typing import AnyStr, IO, Optional, List, Dict, Any from abeja.exceptions import BadRequest from abeja.common.api_client import BaseAPIClient from abeja.common.file_helpers import convert_to_zipfile_object from abeja.common...
import json import tempfile import zipfile from io import BytesIO from pathlib import Path from typing import AnyStr, IO, Optional, List, Dict, Any from abeja.exceptions import BadRequest from abeja.common.api_client import BaseAPIClient from abeja.common.file_helpers import convert_to_zipfile_object from abeja.common...
en
0.545723
A Low-Level client for Training API .. code-block:: python from abeja.training import APIClient api_client = APIClient() create a training job definition API reference: POST /organizations/<organization_id>/training/definitions Request Syntax: .. code-block:: python ...
2.074778
2
cloudify_azure/resources/network/networkinterfacecard.py
cloudify-cosmo/cloudify-azure-plugin
2
6625500
# ####### # Copyright (c) 2016-2020 Cloudify Platform Ltd. 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...
# ####### # Copyright (c) 2016-2020 Cloudify Platform Ltd. 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...
en
0.815068
# ####### # Copyright (c) 2016-2020 Cloudify Platform Ltd. 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...
1.96718
2
aceapi/cloudphish/test.py
ace-ecosystem/ACE
24
6625501
<reponame>ace-ecosystem/ACE<filename>aceapi/cloudphish/test.py # vim: sw=4:ts=4:et import hashlib import logging import os, os.path import threading import time import tarfile from subprocess import Popen, PIPE from unittest import TestCase import saq from aceapi.test import APIBasicTestCase from saq.analysis import...
# vim: sw=4:ts=4:et import hashlib import logging import os, os.path import threading import time import tarfile from subprocess import Popen, PIPE from unittest import TestCase import saq from aceapi.test import APIBasicTestCase from saq.analysis import RootAnalysis from saq.brocess import query_brocess_by_fqdn fro...
en
0.742011
# vim: sw=4:ts=4:et # part of our sample set of data # subprocess for http server # wait for it to start... #def setUp(self, *args, **kwargs): #super().setUp(*args, **kwargs) # make sure our http server is working # first check the result # everything else should be None # we should have a single entry in the cloudphis...
2.019849
2
virt/ansible-latest/lib/python2.7/site-packages/ansible/modules/cloud/amazon/ec2_elb_facts.py
lakhlaifi/RedHat-Ansible
1
6625502
#!/usr/bin/python # # This is a free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This Ansible library is distributed in the hope that i...
#!/usr/bin/python # # This is a free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This Ansible library is distributed in the hope that i...
en
0.685583
#!/usr/bin/python # # This is a free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This Ansible library is distributed in the hope that i...
1.723997
2
problem.py
FlorianEisenbarth/DataCamp_DeputiesWatcher
1
6625503
import pandas as pd import json import numpy as np from dataclasses import dataclass import os from os.path import join, splitext import unidecode import pickle as pkl import sys from sklearn.model_selection import KFold import functools import rampwf from sklearn.base import is_classifier from sklearn.metrics import ...
import pandas as pd import json import numpy as np from dataclasses import dataclass import os from os.path import join, splitext import unidecode import pickle as pkl import sys from sklearn.model_selection import KFold import functools import rampwf from sklearn.base import is_classifier from sklearn.metrics import ...
en
0.624958
Base class containing all relevant basis information of the dataset # en faire un datetime ce serait bien ; à regarder # renommer la première colonne (partis) Transform a Vote object into an observation X of features (dictionnary) and a label y # ---------- # score type # ---------- Custom weighted F1 score. We...
2.209157
2
scraper/storage_spiders/techlandcomvn.py
chongiadung/choinho
0
6625504
<gh_stars>0 # Auto generated by generator.py. Delete this line if you make modification. from scrapy.spiders import Rule from scrapy.linkextractors import LinkExtractor XPATH = { 'name' : "//div[@id='pro_name_head']/h1", 'price' : "//div[@class='pro_detail_price']/b", 'category' : "//div[@class='categoryPa...
# Auto generated by generator.py. Delete this line if you make modification. from scrapy.spiders import Rule from scrapy.linkextractors import LinkExtractor XPATH = { 'name' : "//div[@id='pro_name_head']/h1", 'price' : "//div[@class='pro_detail_price']/b", 'category' : "//div[@class='categoryPath']/div/a",...
en
0.729121
# Auto generated by generator.py. Delete this line if you make modification. #Rule(LinkExtractor(), 'parse_item_and_links'),
2.076571
2
hykufe-client/main.py
sortteam/HyKuFe
3
6625505
<filename>hykufe-client/main.py import hykufe # hykufe.HyKuFeBuilder()\ # .setName("test1").setImage("test2")\ # .setCPU("test3").setMemory("test4")\ # .setGPU("test5").setReplica("test6")\ # .build('access_key', 'secret_key').writeYamlFile("test.yaml") hykufe.HyKuFeBuilder().build('access_key', 'secr...
<filename>hykufe-client/main.py import hykufe # hykufe.HyKuFeBuilder()\ # .setName("test1").setImage("test2")\ # .setCPU("test3").setMemory("test4")\ # .setGPU("test5").setReplica("test6")\ # .build('access_key', 'secret_key').writeYamlFile("test.yaml") hykufe.HyKuFeBuilder().build('access_key', 'secr...
en
0.103137
# hykufe.HyKuFeBuilder()\ # .setName("test1").setImage("test2")\ # .setCPU("test3").setMemory("test4")\ # .setGPU("test5").setReplica("test6")\ # .build('access_key', 'secret_key').writeYamlFile("test.yaml")
1.444063
1
Coronavirus Statictics India/graph/urls.py
ShrayankM/Covid-19-India-Analysis
1
6625506
from django.contrib import admin from django.urls import path, include from graph import views app_name = 'graph' urlpatterns = [ path('pie/', views.pie, name = 'pie'), path('area/', views.area, name = 'area'), ]
from django.contrib import admin from django.urls import path, include from graph import views app_name = 'graph' urlpatterns = [ path('pie/', views.pie, name = 'pie'), path('area/', views.area, name = 'area'), ]
none
1
1.590852
2
scoring/dictionary/YSQ93.py
majazeh/risloo-samples
0
6625507
<filename>scoring/dictionary/YSQ93.py f1= 'ed' f2 = 'ab' f3 = 'ma' f4 = 'si' f5 = 'ds' f6 = 'fa' f7 = 'ai' f8 = 'vu' f9 = 'eu' f10 = 'sb' f11 = 'ss' f12 = 'ei' f13 = 'us' f14 = 'et' f15 = 'is' f16 = 'as' f17 = 'np' f18 = 'pu' factors_names = (f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, f16, f17, ...
<filename>scoring/dictionary/YSQ93.py f1= 'ed' f2 = 'ab' f3 = 'ma' f4 = 'si' f5 = 'ds' f6 = 'fa' f7 = 'ai' f8 = 'vu' f9 = 'eu' f10 = 'sb' f11 = 'ss' f12 = 'ei' f13 = 'us' f14 = 'et' f15 = 'is' f16 = 'as' f17 = 'np' f18 = 'pu' factors_names = (f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, f16, f17, ...
none
1
1.998469
2
ex074.py
felipesch92/PythonExercicios
0
6625508
# Crie um programa que vai gerar cinco números aleatórios e # colocar em uma tupla. Depois disso, mostre a listagem de números # gerados e também indique o menor e o maior valor que estão na tupla. from random import randint numeros = (randint(1, 10), randint(1, 10), randint(1, 10), randint(1, 10), randint(1...
# Crie um programa que vai gerar cinco números aleatórios e # colocar em uma tupla. Depois disso, mostre a listagem de números # gerados e também indique o menor e o maior valor que estão na tupla. from random import randint numeros = (randint(1, 10), randint(1, 10), randint(1, 10), randint(1, 10), randint(1...
pt
0.997626
# Crie um programa que vai gerar cinco números aleatórios e # colocar em uma tupla. Depois disso, mostre a listagem de números # gerados e também indique o menor e o maior valor que estão na tupla.
4.197444
4
dephell/converters/pip.py
eli-schwartz/dephell
0
6625509
<filename>dephell/converters/pip.py<gh_stars>0 # built-in from pathlib import Path from types import SimpleNamespace from typing import Optional from urllib.parse import urlparse # external from dephell_links import DirLink from pip._internal.download import PipSession from pip._internal.index import PackageFinder fro...
<filename>dephell/converters/pip.py<gh_stars>0 # built-in from pathlib import Path from types import SimpleNamespace from typing import Optional from urllib.parse import urlparse # external from dephell_links import DirLink from pip._internal.download import PipSession from pip._internal.index import PackageFinder fro...
en
0.593944
# built-in # external # app # https://github.com/pypa/pip/blob/master/src/pip/_internal/req/constructors.py # https://github.com/pypa/pip/blob/master/src/pip/_internal/req/req_install.py # update repository # get repos urls # dump repos urls # pip._internal.build_env # disable hashes when dir-based deps are presented #...
2.154964
2
user/views.py
Carlosmax1/user-current-track
0
6625510
from django.shortcuts import render from django.http import HttpResponse, response from . import ctrack def user(request): rp = ctrack.Track('carloosxdd','<KEY> <KEY>', 'a', 'a') user = rp.user() return render(request, 'user.html', user)
from django.shortcuts import render from django.http import HttpResponse, response from . import ctrack def user(request): rp = ctrack.Track('carloosxdd','<KEY> <KEY>', 'a', 'a') user = rp.user() return render(request, 'user.html', user)
none
1
1.857057
2
src/tools/docmaker/utils.py
maxon887/freetype
9
6625511
<gh_stars>1-10 # # utils.py # # Auxiliary functions for the `docmaker' tool (library file). # # Copyright 2002-2017 by # <NAME>. # # This file is part of the FreeType project, and may only be used, # modified, and distributed under the terms of the FreeType project # license, LICENSE.TXT. By continu...
# # utils.py # # Auxiliary functions for the `docmaker' tool (library file). # # Copyright 2002-2017 by # <NAME>. # # This file is part of the FreeType project, and may only be used, # modified, and distributed under the terms of the FreeType project # license, LICENSE.TXT. By continuing to use, mod...
en
0.804087
# # utils.py # # Auxiliary functions for the `docmaker' tool (library file). # # Copyright 2002-2017 by # <NAME>. # # This file is part of the FreeType project, and may only be used, # modified, and distributed under the terms of the FreeType project # license, LICENSE.TXT. By continuing to use, modify, or di...
2.870995
3
src/tests/part2/q142_test_linked_list_cycle_ii.py
hychrisli/PyAlgorithms
0
6625512
from src.base.test_cases import TestCases from src.mappers.list2linkedlist import to_linkedlist class LinkedListCycleIiTestCases(TestCases): def __init__(self): super(LinkedListCycleIiTestCases, self).__init__() head, begin = self.gen_list1() self.__add_test_case__('Test 1', head, begin) ...
from src.base.test_cases import TestCases from src.mappers.list2linkedlist import to_linkedlist class LinkedListCycleIiTestCases(TestCases): def __init__(self): super(LinkedListCycleIiTestCases, self).__init__() head, begin = self.gen_list1() self.__add_test_case__('Test 1', head, begin) ...
none
1
3.04913
3
DSK1/code.py
devashri12/greyatom-python-for-data-science
0
6625513
# -------------- #Code starts here def read_file(path): #Function to read file file=open(path,mode='r') #Opening of the file located in the path in 'read' mode sentence=file.read() #Reading of the first line of the file and storing it in a variable file.close() #Closing of the file ...
# -------------- #Code starts here def read_file(path): #Function to read file file=open(path,mode='r') #Opening of the file located in the path in 'read' mode sentence=file.read() #Reading of the first line of the file and storing it in a variable file.close() #Closing of the file ...
en
0.710921
# -------------- #Code starts here #Function to read file #Opening of the file located in the path in 'read' mode #Reading of the first line of the file and storing it in a variable #Closing of the file #Returning the first line of the file #Calling the function to read file #Printing the line of the file #Function to ...
4.140283
4
test.py
zawlinnnaing/my-wiki-crawler
0
6625514
<gh_stars>0 import multiprocessing as mp print("CPU count", mp.cpu_count())
import multiprocessing as mp print("CPU count", mp.cpu_count())
none
1
1.959622
2
pythonProject1/venv/Lib/site-packages/tkinterx/graph/shape.py
mjtomlinson/CNE330_Python_1_Final_Project
0
6625515
#from functools import lru_cache class Rectangle: def __init__(self, bbox): self.x0, self.y0, self.x1, self.y1 = bbox self.bunch = { 'left_top_corner': (self.x0, self.y0), 'top_middle': (self.center[0], self.y0), 'right_top_corner': (self.x1, self.y0), ...
#from functools import lru_cache class Rectangle: def __init__(self, bbox): self.x0, self.y0, self.x1, self.y1 = bbox self.bunch = { 'left_top_corner': (self.x0, self.y0), 'top_middle': (self.center[0], self.y0), 'right_top_corner': (self.x1, self.y0), ...
en
0.509984
#from functools import lru_cache self < other self < other
3.330178
3
Text/vectorizer.py
sergeiGKS/AI-Frameworks
29
6625516
<gh_stars>10-100 import collections from scipy import sparse from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfTransformer from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.feature_extraction import FeatureHasher class Vectorizer: ...
import collections from scipy import sparse from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfTransformer from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.feature_extraction import FeatureHasher class Vectorizer: def __init__(sel...
en
0.686987
# Hashage # Hashage
2.83694
3
experiments/geometric_objects/train.py
brambozz/pl-3D-U-Net
0
6625517
import pytorch_lightning as pl import pl3dunet.unet as unet import generate_dataloader # Define train dataloader def train_dataloader(): return generate_dataloader.get_dataloader() # Initialize network model = unet.UNet(in_channels=1, out_channels=5) model.train_dataloader = train_dataloader trainer = pl.Traine...
import pytorch_lightning as pl import pl3dunet.unet as unet import generate_dataloader # Define train dataloader def train_dataloader(): return generate_dataloader.get_dataloader() # Initialize network model = unet.UNet(in_channels=1, out_channels=5) model.train_dataloader = train_dataloader trainer = pl.Traine...
en
0.533313
# Define train dataloader # Initialize network
2.364131
2
starfish/core/spots/FindSpots/_base.py
haoxusci/starfish
0
6625518
from abc import abstractmethod from typing import Callable, Optional import numpy as np from starfish.core.imagestack.imagestack import ImageStack from starfish.core.pipeline.algorithmbase import AlgorithmBase from starfish.core.types import Number, SpotFindingResults class FindSpotsAlgorithm(metaclass=AlgorithmBas...
from abc import abstractmethod from typing import Callable, Optional import numpy as np from starfish.core.imagestack.imagestack import ImageStack from starfish.core.pipeline.algorithmbase import AlgorithmBase from starfish.core.types import Number, SpotFindingResults class FindSpotsAlgorithm(metaclass=AlgorithmBas...
en
0.89896
Starfish spot finders use a variety of means to detect bright spots against dark backgrounds. Starfish's spot detectors each have different strengths and weaknesses. **Fixed-position spot finders** The following spot finders have two modes of operation. The first mode is suitable for coded experi...
2.431979
2
code/main.py
qatoqat/osu-background-remover
1
6625519
<filename>code/main.py<gh_stars>1-10 # from os import listdir from os.path import isfile, join from os import path as fpath from os import walk, makedirs from PIL import Image import errno import shutil mypath = "E:\-Ext-\osu\Songs" bakpath = mypath + "\imgbak" chosencolor = (10, 10, 10) # onlyfiles = [f for f in list...
<filename>code/main.py<gh_stars>1-10 # from os import listdir from os.path import isfile, join from os import path as fpath from os import walk, makedirs from PIL import Image import errno import shutil mypath = "E:\-Ext-\osu\Songs" bakpath = mypath + "\imgbak" chosencolor = (10, 10, 10) # onlyfiles = [f for f in list...
en
0.672255
# from os import listdir # onlyfiles = [f for f in listdir(mypath) if isfile(join(mypath, f))] # create folder for backup # raises the error again # loop directory # check if file is an image # raises the error again
3.048923
3
source/story.py
noltron000-coursework/adventure
1
6625520
from event import * class Story: ''' A story points a reader to the first event. It also holds metadata, such as its title. Finally, it holds the function of impetus -- self.write(). This thing sets off all the recursion within the Event. ''' def __init__(self): # The content is long-form, unformatted text....
from event import * class Story: ''' A story points a reader to the first event. It also holds metadata, such as its title. Finally, it holds the function of impetus -- self.write(). This thing sets off all the recursion within the Event. ''' def __init__(self): # The content is long-form, unformatted text....
en
0.906007
A story points a reader to the first event. It also holds metadata, such as its title. Finally, it holds the function of impetus -- self.write(). This thing sets off all the recursion within the Event. # The content is long-form, unformatted text. # It is essentially the meta-data of the story. # The first event of...
3.833477
4
Scarky2/account/views.py
kopringo/Scarky2
0
6625521
def signup(request): pass def signup_confirm(request): pass
def signup(request): pass def signup_confirm(request): pass
none
1
0.919145
1
cdfs_rows.py
abeagomez/nonograms_solver
0
6625522
<gh_stars>0 from itertools import combinations_with_replacement from cdfs_box import Stack, problem, build_board from pprint import pprint def gen_lines(width, pattern): """ This yields a tuple for each possible layout of pattern inside the row. The tuple elements are the gaps before each block in pat...
from itertools import combinations_with_replacement from cdfs_box import Stack, problem, build_board from pprint import pprint def gen_lines(width, pattern): """ This yields a tuple for each possible layout of pattern inside the row. The tuple elements are the gaps before each block in pattern. Th...
en
0.797376
This yields a tuple for each possible layout of pattern inside the row. The tuple elements are the gaps before each block in pattern. The tuple doesn't include the last gap, since that's just: width - sum(sol) - sum(pattern) expands a solution to a tuple of 1 (ON) and 0 (OFF) # Each state is the current...
3.142236
3
tests/exam/while2.py
Mieschendahl/assignment-final-stub
0
6625523
<filename>tests/exam/while2.py #in= #golden=12345 i = 1 while i < 6: print(i) i = i + 1
<filename>tests/exam/while2.py #in= #golden=12345 i = 1 while i < 6: print(i) i = i + 1
zh
0.507815
#in= #golden=12345
2.760688
3
mobula/__init__.py
wkcn/mobula
47
6625524
from .Net import * from .wrapper import *
from .Net import * from .wrapper import *
none
1
1.062995
1
classification/dataloder.py
utsabbuet17/DSPProject84
0
6625525
<gh_stars>0 from torchvision.datasets import ImageFolder from torch.utils.data import DataLoader def TrainLoader(batchSize, imgDir, trainTransform) : dataloader = DataLoader(ImageFolder(imgDir, trainTransform), batch_size=batchSize, shuffle=True)# transform is for image to tensor making return dataloader def V...
from torchvision.datasets import ImageFolder from torch.utils.data import DataLoader def TrainLoader(batchSize, imgDir, trainTransform) : dataloader = DataLoader(ImageFolder(imgDir, trainTransform), batch_size=batchSize, shuffle=True)# transform is for image to tensor making return dataloader def ValLoader(bat...
en
0.961287
# transform is for image to tensor making
2.984951
3
website/urls.py
Arman19891006/Mysite
0
6625526
<gh_stars>0 from django.urls import path from website.views import * app_name = 'website' urlpatterns = [ path('' , index_view , name = 'index'), path('about' , about_view,name = 'about'), path('contact' , contact_view,name = 'contact'), path('test' , test_view,name = 'test'), ]
from django.urls import path from website.views import * app_name = 'website' urlpatterns = [ path('' , index_view , name = 'index'), path('about' , about_view,name = 'about'), path('contact' , contact_view,name = 'contact'), path('test' , test_view,name = 'test'), ]
none
1
1.894136
2
rc3_m3u.py
KOLANICH-tools/rc3_ical_fahrplan.py
0
6625527
<gh_stars>0 #!/usr/bin/env python3 import sys from datetime import datetime, timedelta from pathlib import Path try: import ujson as json except ImportError: import json rooms = { "cbase": "c-base", "cwtv": "Chaos-West TV", "r3s": "Remote Rhein Ruhr Stage", "csh": "ChaosStudio Hamburg", "chaoszone": "ChaosZon...
#!/usr/bin/env python3 import sys from datetime import datetime, timedelta from pathlib import Path try: import ujson as json except ImportError: import json rooms = { "cbase": "c-base", "cwtv": "Chaos-West TV", "r3s": "Remote Rhein Ruhr Stage", "csh": "ChaosStudio Hamburg", "chaoszone": "ChaosZone TV", "fem...
fr
0.221828
#!/usr/bin/env python3
2.307096
2
python/bifrost/views/basic_views.py
Radio-Camera-Initiative/bifrost
0
6625528
# Copyright (c) 2016, The Bifrost Authors. 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 # notice, this list of conditions a...
# Copyright (c) 2016, The Bifrost Authors. 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 # notice, this list of conditions a...
en
0.76255
# Copyright (c) 2016, The Bifrost Authors. 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 # notice, this list of conditions an...
1.488988
1
botnet.py
PlannedTube9/ZeusbotPort
0
6625529
<filename>botnet.py<gh_stars>0 #!/usr/bin/python2.7 # -*- coding: utf-8 from utils import Utils import json import logging import random logger = logging.getLogger(__name__) class Botnet: ut = Utils() def __init__(self, player): self.username = player.username self.password = <PASSWORD> ...
<filename>botnet.py<gh_stars>0 #!/usr/bin/python2.7 # -*- coding: utf-8 from utils import Utils import json import logging import random logger = logging.getLogger(__name__) class Botnet: ut = Utils() def __init__(self, player): self.username = player.username self.password = <PASSWORD> ...
en
0.640965
#!/usr/bin/python2.7 # -*- coding: utf-8 Grab the amount of bots in the botnet and populate and array of Bot class :return: none Print a list of player PCs in the botnet :return: None Return an array of bot class. Contains all the bots in the botnet. :return: list of bot class Ge...
3.122351
3
tests/models/xDeepFM_test.py
HazzaCheng/DeepCTR
2
6625530
<gh_stars>1-10 import pytest import tensorflow as tf from deepctr.estimator import xDeepFMEstimator from deepctr.models import xDeepFM from ..utils import check_model, get_test_data, SAMPLE_SIZE, get_test_data_estimator, check_estimator, \ Estimator_TEST_TF1 @pytest.mark.parametrize( 'dnn_hidden_units,cin_la...
import pytest import tensorflow as tf from deepctr.estimator import xDeepFMEstimator from deepctr.models import xDeepFM from ..utils import check_model, get_test_data, SAMPLE_SIZE, get_test_data_estimator, check_estimator, \ Estimator_TEST_TF1 @pytest.mark.parametrize( 'dnn_hidden_units,cin_layer_size,cin_sp...
en
0.27497
# ((), (), True, 'linear', 1, 2), # @pytest.mark.parametrize( # 'hidden_size,cin_layer_size,', # [((8,), (3, 8)), # ] # ) # def test_xDeepFM_invalid(hidden_size, cin_layer_size): # feature_dim_dict = {'sparse': {'sparse_1': 2, 'sparse_2': 5, # 'sparse_3': 10}, 'dense'...
2.334799
2
test/functional/feature_blockfilterindex_prune.py
picacoin/picacoin
1
6625531
<filename>test/functional/feature_blockfilterindex_prune.py #!/usr/bin/env python3 # Copyright (c) 2020 The Picacoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test blockfilterindex in conjunction with prune...
<filename>test/functional/feature_blockfilterindex_prune.py #!/usr/bin/env python3 # Copyright (c) 2020 The Picacoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test blockfilterindex in conjunction with prune...
en
0.645886
#!/usr/bin/env python3 # Copyright (c) 2020 The Picacoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. Test blockfilterindex in conjunction with prune. # Mine two batches of blocks to avoid hitting NODE_NETWORK_LI...
2.164608
2
yt/testing.py
tukss/yt
0
6625532
<reponame>tukss/yt import functools import hashlib import importlib import itertools as it import os import pickle import shutil import tempfile import unittest import matplotlib import numpy as np from numpy.random import RandomState from unyt.exceptions import UnitOperationError from yt.config import ytcfg from yt....
import functools import hashlib import importlib import itertools as it import os import pickle import shutil import tempfile import unittest import matplotlib import numpy as np from numpy.random import RandomState from unyt.exceptions import UnitOperationError from yt.config import ytcfg from yt.funcs import iterab...
en
0.788411
# we import this in a weird way from numpy.testing to avoid triggering # flake8 errors from the unused imports. These test functions are imported # elsewhere in yt from here so we want them to be imported here. # NOQA isort:skip # NOQA isort:skip # NOQA isort:skip # NOQA isort:skip # NOQA isort:skip # NOQA isort:skip #...
2.279377
2
fastestimator/architecture/retinanet.py
fastestimator-util/test_nightly
0
6625533
<filename>fastestimator/architecture/retinanet.py # Copyright 2019 The FastEstimator 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.or...
<filename>fastestimator/architecture/retinanet.py # Copyright 2019 The FastEstimator 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.or...
en
0.695196
# Copyright 2019 The FastEstimator 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 appl...
2.529352
3
easygraph/functions/centrality/clossness.py
easy-graph/Easy-Graph
41
6625534
from easygraph.functions.path import * __all__ = [ 'closeness_centrality', ] def closeness_centrality(G, weight=None): '''Compute closeness centrality for nodes. .. math:: C_{WF}(u) = \frac{n-1}{N-1} \frac{n - 1}{\sum_{v=1}^{n-1} d(v, u)}, Notice that the closeness distance function com...
from easygraph.functions.path import * __all__ = [ 'closeness_centrality', ] def closeness_centrality(G, weight=None): '''Compute closeness centrality for nodes. .. math:: C_{WF}(u) = \frac{n-1}{N-1} \frac{n - 1}{\sum_{v=1}^{n-1} d(v, u)}, Notice that the closeness distance function com...
en
0.71934
Compute closeness centrality for nodes. .. math:: C_{WF}(u) = \frac{n-1}{N-1} \frac{n - 1}{\sum_{v=1}^{n-1} d(v, u)}, Notice that the closeness distance function computes the outcoming distance to `u` for directed graphs. To use incoming distance, act on `G.reverse()`. Parameters ...
3.454573
3
settingsUI.py
5parkp1ug/ytDLDR
1
6625535
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'settings1.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(s):...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'settings1.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(s):...
en
0.769136
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'settings1.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WARNING! All changes made in this file will be lost!
1.707077
2
lio/losses/classification.py
YivanZhang/lio
8
6625536
from typing import Callable, List import torch import torch.nn.functional as F from torch.distributions import Categorical def direct_observation_loss(t: torch.Tensor, y: torch.Tensor) -> torch.Tensor: return F.cross_entropy(t, y) def indirect_observation_loss(transition_matrix: torch.Tensor, activation: Calla...
from typing import Callable, List import torch import torch.nn.functional as F from torch.distributions import Categorical def direct_observation_loss(t: torch.Tensor, y: torch.Tensor) -> torch.Tensor: return F.cross_entropy(t, y) def indirect_observation_loss(transition_matrix: torch.Tensor, activation: Calla...
en
0.401144
# ---------------------------------------------------------------------------------------------------------------------- # https://arxiv.org/abs/1412.6596 # entropy regularization # https://arxiv.org/abs/1412.6596 # log-likelihood regularization # https://arxiv.org/abs/1708.02002 # https://arxiv.org/abs/1805.07836
2.219853
2
tools/CountColor.py
WanderMax/notepad2
1
6625537
#!/usr/bin/env python3 #-*- coding: UTF-8 -*- import sys import os.path import operator import re kReColorHex = re.compile(r'#[0-9A-Fa-f]{6}') def parse_key_value(line): line = line.strip() if not line or line[0] in ';#[': return None items = line.split('=', 2) if not items or len(items) != 2: return None ...
#!/usr/bin/env python3 #-*- coding: UTF-8 -*- import sys import os.path import operator import re kReColorHex = re.compile(r'#[0-9A-Fa-f]{6}') def parse_key_value(line): line = line.strip() if not line or line[0] in ';#[': return None items = line.split('=', 2) if not items or len(items) != 2: return None ...
en
0.352775
#!/usr/bin/env python3 #-*- coding: UTF-8 -*- #[': # { color : { total_count: total_count, usage: { key: count}}} Usage: %s path
3.206065
3
Rent 4.0/__dependency__.py
girisakar365/Project-Rent
2
6625538
<gh_stars>1-10 from tkinter import * from tkinter import messagebox from db import db bg = db.cache(0,'get') bg_dict = { '1': '#fdfddb', '2': '#cecece', '3': '#f2d000', '4':'#ff0000', '5':'#2bc760', '6':'#143d8c', '7':'#8abadb', '8':'#936cca' } apply_bg = bg_dict['{}'...
from tkinter import * from tkinter import messagebox from db import db bg = db.cache(0,'get') bg_dict = { '1': '#fdfddb', '2': '#cecece', '3': '#f2d000', '4':'#ff0000', '5':'#2bc760', '6':'#143d8c', '7':'#8abadb', '8':'#936cca' } apply_bg = bg_dict['{}'.format(bg)] ...
en
0.557155
#\defaultfunction\ #Include.tip(win,digiclock,'Time') #Include.tip(win,digidate,'Date') #selectmonth #selectyear #Include.tip(win,widget,'Show') #Include.tip(win,widget,'Unshow') #miliseconds #pixels # creates a toplevel window # Leaves only the label and removes the app window
3.024162
3
code/analysis/old/calc_pairwise_KL_divergence.py
tkc-morita/variational_inference_DP_mix_HDP_topic_ngram
4
6625539
# coding: utf-8 import pandas as pd import numpy as np import sys, os.path, itertools def get_pairwise_KL_divergence(df_post_ngram, context_frequency): # print np.max(np.abs(df_post_ngram.groupby(['sublex_id','context']).prob.sum() - 1)) df_post_ngram = df_post_ngram.sort_values(['sublex_id','context','value']) df...
# coding: utf-8 import pandas as pd import numpy as np import sys, os.path, itertools def get_pairwise_KL_divergence(df_post_ngram, context_frequency): # print np.max(np.abs(df_post_ngram.groupby(['sublex_id','context']).prob.sum() - 1)) df_post_ngram = df_post_ngram.sort_values(['sublex_id','context','value']) df...
en
0.366787
# coding: utf-8 # print np.max(np.abs(df_post_ngram.groupby(['sublex_id','context']).prob.sum() - 1)) # print 'A' # print df_sublex_A # print 'B' # print df_sublex_B
2.535523
3
utils/src/ave/__init__.py
yiu31802/ave
17
6625540
<gh_stars>10-100 # Copyright (C) 2013 Sony Mobile Communications AB. # All rights, including trade secret rights, reserved. import pkg_resources import modulefinder # the ave Python package is implemented in several Debian packages (git trees # really). this causes problems when importing different ave modules from #...
# Copyright (C) 2013 Sony Mobile Communications AB. # All rights, including trade secret rights, reserved. import pkg_resources import modulefinder # the ave Python package is implemented in several Debian packages (git trees # really). this causes problems when importing different ave modules from # different source...
en
0.839371
# Copyright (C) 2013 Sony Mobile Communications AB. # All rights, including trade secret rights, reserved. # the ave Python package is implemented in several Debian packages (git trees # really). this causes problems when importing different ave modules from # different source paths. consider the following template whi...
1.939206
2
Examples/DiskMargin.py
UASLab/OpenFlightAnalysis
7
6625541
#%% import numpy as np import matplotlib.pyplot as plt import matplotlib.patches # Hack to allow loading the Core package if __name__ == "__main__" and __package__ is None: from sys import path, argv from os.path import dirname, abspath, join path.insert(0, abspath(join(dirname(argv[0]), ".."))) path.i...
#%% import numpy as np import matplotlib.pyplot as plt import matplotlib.patches # Hack to allow loading the Core package if __name__ == "__main__" and __package__ is None: from sys import path, argv from os.path import dirname, abspath, join path.insert(0, abspath(join(dirname(argv[0]), ".."))) path.i...
en
0.225316
#%% # Hack to allow loading the Core package #%% #rCritNomCirc, rCritUncCirc, rCritCirc = FreqTrans.DistCritCirc(T, TUnc, pCrit = pCrit, typeNorm = 'RMS') # RMS #rCirc = np.max([TUnc.real, TUnc.imag]) # Max #rCirc = np.mean([TUnc.real, TUnc.imag]) # Mean #rCirc = np.abs(TUnc) # RSS #%
2.012405
2
corehq/apps/export/migrations/0005_datafile_blobmeta.py
dannyroberts/commcare-hq
0
6625542
# -*- coding: utf-8 -*- # Generated by Django 1.11.14 on 2018-08-03 17:32 from __future__ import unicode_literals from __future__ import absolute_import from django.db import migrations from corehq.blobs import CODES from corehq.sql_db.util import get_db_alias_for_partitioned_doc def move_datafile_to_blobmeta(apps...
# -*- coding: utf-8 -*- # Generated by Django 1.11.14 on 2018-08-03 17:32 from __future__ import unicode_literals from __future__ import absolute_import from django.db import migrations from corehq.blobs import CODES from corehq.sql_db.util import get_db_alias_for_partitioned_doc def move_datafile_to_blobmeta(apps...
en
0.887535
# -*- coding: utf-8 -*- # Generated by Django 1.11.14 on 2018-08-03 17:32 # At time of writing there are only 91 DataFile rows on prod, 1 on icds-new # this may need to be changed if envs exist having many many more # # '_default' is the bucket name from the old blob db API.
1.922354
2
train.py
ruthcrasto/meta-optim-public
38
6625543
<reponame>ruthcrasto/meta-optim-public # ============================================================================= # Copyright (c) 2018 <NAME> # # 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 Sof...
# ============================================================================= # Copyright (c) 2018 <NAME> # # 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 wi...
en
0.721122
# ============================================================================= # Copyright (c) 2018 <NAME> # # 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 wi...
1.462948
1
enigmatoolbox/vtk_interface/io_support/freesurfer_support.py
saratheriver/ENIGMA
0
6625544
<gh_stars>0 """VTK read/write filters for FreeSurfer geometry files.""" # Author: <NAME> <<EMAIL>> # License: BSD 3 clause import re import numpy as np from vtk import vtkPolyData from vtk.util.vtkAlgorithm import VTKPythonAlgorithmBase from ..checks import has_only_triangle from ..decorators import wrap_input fro...
"""VTK read/write filters for FreeSurfer geometry files.""" # Author: <NAME> <<EMAIL>> # License: BSD 3 clause import re import numpy as np from vtk import vtkPolyData from vtk.util.vtkAlgorithm import VTKPythonAlgorithmBase from ..checks import has_only_triangle from ..decorators import wrap_input from ...mesh.me...
en
0.533094
VTK read/write filters for FreeSurfer geometry files. # Author: <NAME> <<EMAIL>> # License: BSD 3 clause Read a 3-byte int from an open binary file object Parameters ---------- fobj : file File descriptor Returns ------- n : int A 3 byte int Read 3-byte ints from an open binary f...
2.38857
2
statistic_analysis/result_analysis_hist_Impact_K_OE.py
proroklab/magat_pathplanning
40
6625545
<reponame>proroklab/magat_pathplanning from scipy.io import loadmat import numpy as np import os import csv import matplotlib.pyplot as plt import matplotlib.font_manager matplotlib.font_manager._rebuild() plt.rcParams['font.family'] = "serif" import matplotlib.ticker as ticker plt.rcParams.update({'font.size': 22}) ...
from scipy.io import loadmat import numpy as np import os import csv import matplotlib.pyplot as plt import matplotlib.font_manager matplotlib.font_manager._rebuild() plt.rcParams['font.family'] = "serif" import matplotlib.ticker as ticker plt.rcParams.update({'font.size': 22}) import pandas as pd import matplotlib ...
en
0.467584
# print os.path.join(subdir, file) # print(subdir, file) # print(len(data_list)) # return data # title_exp_setup = ('trained on {} agents and tested on {} agents'.format(self.trained_num_agent, testing_num_agent)) # self.title_text = 'Histogram of percentage (# agents reach goal among {} cases) \n in network is {}.'.fo...
2.421584
2
Code/compute_all_test.py
Noixas/Evaluating-Bias-In-Dutch-Word-Embeddings
0
6625546
# To add a new cell, type '# %%' # To add a new markdown cell, type '# %% [markdown]' # %% from IPython import get_ipython # %% [markdown] # # Streamlined testing for word embeddings # %% import numpy as np import pandas as pd from numpy import linalg import fasttext.util from gensim.models.fasttext import FastText, ...
# To add a new cell, type '# %%' # To add a new markdown cell, type '# %% [markdown]' # %% from IPython import get_ipython # %% [markdown] # # Streamlined testing for word embeddings # %% import numpy as np import pandas as pd from numpy import linalg import fasttext.util from gensim.models.fasttext import FastText, ...
en
0.394655
# To add a new cell, type '# %%' # To add a new markdown cell, type '# %% [markdown]' # %% # %% [markdown] # # Streamlined testing for word embeddings # %% # %% # %% #visualize imports # %% [markdown] # ## Load models # Methods used to load different combinations of models # %% # %% # old name -> "cc.nl.300_fasttext.bi...
2.281811
2
django_tenants/models.py
safaariman/django-tenants
0
6625547
<filename>django_tenants/models.py from django.conf import settings from django.contrib.sites.shortcuts import get_current_site from django.core.management import call_command from django.db import models, connections, transaction from django.urls import reverse from django_tenants.clone import CloneSchema from .postg...
<filename>django_tenants/models.py from django.conf import settings from django.contrib.sites.shortcuts import get_current_site from django.core.management import call_command from django.db import models, connections, transaction from django.urls import reverse from django_tenants.clone import CloneSchema from .postg...
en
0.818159
All tenant models must inherit this class. USE THIS WITH CAUTION! Set this flag to true on a parent class if you want the schema to be automatically deleted if the tenant row gets deleted. Set this flag to false on a parent class if you don't want the schema to be automatically created upon save. Leave this...
2.050719
2
sdpp_seller/seller_websockets.py
AdnanMuhib/DDM
0
6625548
<filename>sdpp_seller/seller_websockets.py<gh_stars>0 # Copyright (c) 2018, Autonomous Networks Research Group. All rights reserved. # Read license file in main directory for more details #!/usr/bin/env python import asyncio import json import random import iota import websockets # Connect to the tangle seed = ...
<filename>sdpp_seller/seller_websockets.py<gh_stars>0 # Copyright (c) 2018, Autonomous Networks Research Group. All rights reserved. # Read license file in main directory for more details #!/usr/bin/env python import asyncio import json import random import iota import websockets # Connect to the tangle seed = ...
en
0.71355
# Copyright (c) 2018, Autonomous Networks Research Group. All rights reserved. # Read license file in main directory for more details #!/usr/bin/env python # Connect to the tangle # TODO receive it from the buyer # TODO: put the actual value # await asyncio.sleep(random.random() * 3)
2.46214
2
music player.py
vijayeshmt/Musicplayer
1
6625549
<reponame>vijayeshmt/Musicplayer from pygame import mixer mixer.init() l = ['Nadiyonpaar.mp3','chandh.mp3'] m = int(input("Choose song\n1.Nadiyoonpaar\n2.Chandh")) s = l[m-1] mixer.music.load(s) mixer.music.set_volume(0.7) mixer.music.play() while True: print("Press 'p' to pause, 'r' to resume") print("...
from pygame import mixer mixer.init() l = ['Nadiyonpaar.mp3','chandh.mp3'] m = int(input("Choose song\n1.Nadiyoonpaar\n2.Chandh")) s = l[m-1] mixer.music.load(s) mixer.music.set_volume(0.7) mixer.music.play() while True: print("Press 'p' to pause, 'r' to resume") print("Press 'e' to exit the program") ...
en
0.718533
# Pausing the music # Resuming the music # Stop the mixer
3.123015
3
test/test_convert.py
NextSecurity/sast-scanner-modified
1
6625550
import lib.convert as convertLib import lib.issue as issueLib import importlib import json import os import tempfile import uuid def test_nodejsscan_convert_empty(): with tempfile.NamedTemporaryFile(mode="w", encoding="utf-8", delete=True) as cfile: data = convertLib.report("nodejsscan", [], ".", {}, {}...
import lib.convert as convertLib import lib.issue as issueLib import importlib import json import os import tempfile import uuid def test_nodejsscan_convert_empty(): with tempfile.NamedTemporaryFile(mode="w", encoding="utf-8", delete=True) as cfile: data = convertLib.report("nodejsscan", [], ".", {}, {}...
en
0.782037
# Override the workspace and check the location # Override the workspace and check the location
2.524684
3