uid
stringlengths
24
24
split
stringclasses
1 value
category
stringclasses
2 values
content
stringlengths
5
482k
signature
stringlengths
1
14k
suffix
stringlengths
1
482k
prefix
stringlengths
9
14k
prefix_token_count
int64
3
5.01k
prefix_token_budget
int64
64
256
element_token_count
int64
1
292k
signature_token_count
int64
1
5.01k
prefix_context_token_count
int64
0
255
repo
stringlengths
7
112
path
stringlengths
4
208
language
stringclasses
1 value
name
stringlengths
1
218
qualname
stringlengths
1
218
start_line
int64
1
26.7k
end_line
int64
1
26.7k
signature_start_line
int64
1
26.7k
signature_end_line
int64
1
26.7k
source_hash
stringlengths
40
40
source_dataset
stringclasses
1 value
source_split
stringclasses
1 value
bf35c0b263ba9fe186297f46
train
class
class AgentPool(SubResource): """Agent Pool. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Resource ID. :vartype id: str :ivar name: The name of the resource that is unique within a resource group. This name can be used to access the res...
class AgentPool(SubResource):
"""Agent Pool. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Resource ID. :vartype id: str :ivar name: The name of the resource that is unique within a resource group. This name can be used to access the resource. :vartype name: str ...
import Model from msrest.exceptions import HttpOperationError class SubResource(Model): """Reference to another subresource. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Resource ID. :vartype id: str :ivar name: The name of the resource t...
256
256
4,117
6
249
Mannan2812/azure-cli-extensions
src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2020_12_01/models/_models_py3.py
Python
AgentPool
AgentPool
50
300
50
50
ad5038f23eeb3aefdd58ceeb600dd269cc4a6665
bigcode/the-stack
train
1e19157509815f240078aa05
train
class
class PrivateEndpoint(Model): """Private endpoint which a connection belongs to. :param id: The resource Id for private endpoint :type id: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, } def __init__(self, *, id: str=None, **kwargs) -> None: super(PrivateE...
class PrivateEndpoint(Model):
"""Private endpoint which a connection belongs to. :param id: The resource Id for private endpoint :type id: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, } def __init__(self, *, id: str=None, **kwargs) -> None: super(PrivateEndpoint, self).__init__(**kwar...
_attribute_map = { 'code': {'key': 'code', 'type': 'str'}, } def __init__(self, *, code=None, **kwargs) -> None: super(PowerState, self).__init__(**kwargs) self.code = code class PrivateEndpoint(Model):
64
64
98
5
58
Mannan2812/azure-cli-extensions
src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2020_12_01/models/_models_py3.py
Python
PrivateEndpoint
PrivateEndpoint
2,622
2,635
2,622
2,622
edbdce73cb99907951305f5dd08d8358468d94c0
bigcode/the-stack
train
83d46ecc3836040f7759451a
train
class
class ManagedClusterLoadBalancerProfile(Model): """Profile of the managed cluster load balancer. :param managed_outbound_ips: Desired managed outbound IPs for the cluster load balancer. :type managed_outbound_ips: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterLoadBalancerProfileMa...
class ManagedClusterLoadBalancerProfile(Model):
"""Profile of the managed cluster load balancer. :param managed_outbound_ips: Desired managed outbound IPs for the cluster load balancer. :type managed_outbound_ips: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs :param outbound_ip_prefixes...
UserAssignedIdentitiesValue(Model): """ManagedClusterIdentityUserAssignedIdentitiesValue. Variables are only populated by the server, and will be ignored when sending a request. :ivar principal_id: The principal id of user assigned identity. :vartype principal_id: str :ivar client_id: The clie...
212
212
709
8
203
Mannan2812/azure-cli-extensions
src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2020_12_01/models/_models_py3.py
Python
ManagedClusterLoadBalancerProfile
ManagedClusterLoadBalancerProfile
2,010
2,061
2,010
2,010
3b77a2b2b05dee1e4f952c808845f413326a0665
bigcode/the-stack
train
7930b834383054e21cca9811
train
class
class ResourceReference(Model): """A reference to an Azure resource. :param id: The fully qualified Azure resource id. :type id: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, } def __init__(self, *, id: str=None, **kwargs) -> None: super(ResourceReference,...
class ResourceReference(Model):
"""A reference to an Azure resource. :param id: The fully qualified Azure resource id. :type id: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, } def __init__(self, *, id: str=None, **kwargs) -> None: super(ResourceReference, self).__init__(**kwargs) ...
', 'type': 'str'}, } def __init__(self, *, status=None, description: str=None, **kwargs) -> None: super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) self.status = status self.description = description class ResourceReference(Model):
64
64
96
5
58
Mannan2812/azure-cli-extensions
src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2020_12_01/models/_models_py3.py
Python
ResourceReference
ResourceReference
2,793
2,806
2,793
2,793
2111ff4e388ba771a063293583f06f4b187e8a29
bigcode/the-stack
train
e5cf4f67e102d314b3047545
train
class
class CredentialResult(Model): """The credential result response. Variables are only populated by the server, and will be ignored when sending a request. :ivar name: The name of the credential. :vartype name: str :ivar value: Base64-encoded Kubernetes configuration file. :vartype value: by...
class CredentialResult(Model):
"""The credential result response. Variables are only populated by the server, and will be ignored when sending a request. :ivar name: The name of the credential. :vartype name: str :ivar value: Base64-encoded Kubernetes configuration file. :vartype value: bytearray """ _validatio...
': 'storageUri', 'type': 'str'}, } def __init__(self, *, enabled: bool, **kwargs) -> None: super(ContainerServiceVMDiagnostics, self).__init__(**kwargs) self.enabled = enabled self.storage_uri = None class CredentialResult(Model):
64
64
180
5
58
Mannan2812/azure-cli-extensions
src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2020_12_01/models/_models_py3.py
Python
CredentialResult
CredentialResult
852
877
852
852
a736553c43abc0a39ed49caef4a6077b12ed8192
bigcode/the-stack
train
8e665f3fe539c6034ed6683e
train
class
class Resource(Model): """The Resource model definition. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. :ivar id: Resource Id :vartype id: str :ivar name: Resource name :varty...
class Resource(Model):
"""The Resource model definition. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar ...
Week]'}, 'not_allowed_time': {'key': 'properties.notAllowedTime', 'type': '[TimeSpan]'}, } def __init__(self, *, time_in_week=None, not_allowed_time=None, **kwargs) -> None: super(MaintenanceConfiguration, self).__init__(**kwargs) self.system_data = None self.time_in_week = time...
97
97
324
4
92
Mannan2812/azure-cli-extensions
src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/v2020_12_01/models/_models_py3.py
Python
Resource
Resource
1,050
1,091
1,050
1,050
79bd3ee519004b3f52e3a1d23112251d66b167dd
bigcode/the-stack
train
96526df09df90cb7f5dbff13
train
function
@image_comparison(baseline_images=['constrained_layout4']) def test_constrained_layout4(): 'Test constrained_layout for a single colorbar with subplots' fig, axs = plt.subplots(2, 2, constrained_layout=True) for ax in axs.flatten(): pcm = example_pcolor(ax, fontsize=24) fig.colorbar(pcm, ax=axs,...
@image_comparison(baseline_images=['constrained_layout4']) def test_constrained_layout4():
'Test constrained_layout for a single colorbar with subplots' fig, axs = plt.subplots(2, 2, constrained_layout=True) for ax in axs.flatten(): pcm = example_pcolor(ax, fontsize=24) fig.colorbar(pcm, ax=axs, pad=0.01, shrink=0.6)
if nn == 3: pad = 0.08 else: pad = 0.02 # default fig.colorbar(pcm, ax=ax, pad=pad) @image_comparison(baseline_images=['constrained_layout4']) def test_constrained_layout4():
64
64
94
21
43
AbdulHoffmann/carla_carissma
PythonAPI/carissma_project/lib/python3.5/site-packages/matplotlib/tests/test_constrainedlayout.py
Python
test_constrained_layout4
test_constrained_layout4
68
74
68
69
9ef0d82e7127147f04d11e48c82ca45e54533585
bigcode/the-stack
train
513901b2eb3005d889b1c450
train
function
@image_comparison(baseline_images=['constrained_layout12'], extensions=['png']) def test_constrained_layout12(): 'Test that very unbalanced labeling still works.' fig = plt.figure(constrained_layout=True) gs0 = gridspec.GridSpec(6, 2, figure=fig) ax1 = fig.add_subplot(gs0[:3, 1]) ax2 = fig...
@image_comparison(baseline_images=['constrained_layout12'], extensions=['png']) def test_constrained_layout12():
'Test that very unbalanced labeling still works.' fig = plt.figure(constrained_layout=True) gs0 = gridspec.GridSpec(6, 2, figure=fig) ax1 = fig.add_subplot(gs0[:3, 1]) ax2 = fig.add_subplot(gs0[3:, 1]) example_plot(ax1, fontsize=24) example_plot(ax2, fontsize=24) ax = fig.add_subplot...
bar(pcm, ax=axs, shrink=0.6, aspect=70.) ax = fig.add_subplot(gsl[0]) example_plot(ax, fontsize=9) @image_comparison(baseline_images=['constrained_layout12'], extensions=['png']) def test_constrained_layout12():
64
64
196
26
38
AbdulHoffmann/carla_carissma
PythonAPI/carissma_project/lib/python3.5/site-packages/matplotlib/tests/test_constrainedlayout.py
Python
test_constrained_layout12
test_constrained_layout12
226
246
226
228
93d6f6912b0096719d31415096254c7d597bd1f6
bigcode/the-stack
train
f24920fd4c7d856814e9a492
train
function
@image_comparison(baseline_images=['constrained_layout11'], extensions=['png']) def test_constrained_layout11(): 'Test for multiple nested gridspecs ' fig = plt.figure(constrained_layout=True, figsize=(10, 3)) gs0 = gridspec.GridSpec(1, 2, figure=fig) gsl = gridspec.GridSpecFromSubplotSpec(1, 2,...
@image_comparison(baseline_images=['constrained_layout11'], extensions=['png']) def test_constrained_layout11():
'Test for multiple nested gridspecs ' fig = plt.figure(constrained_layout=True, figsize=(10, 3)) gs0 = gridspec.GridSpec(1, 2, figure=fig) gsl = gridspec.GridSpecFromSubplotSpec(1, 2, gs0[0]) gsl0 = gridspec.GridSpecFromSubplotSpec(2, 2, gsl[1]) ax = fig.add_subplot(gs0[1]) example_plot(ax, ...
.flatten(): ax.plot(np.arange(12), label='This is a label') ax.legend(loc='center left', bbox_to_anchor=(0.8, 0.5)) @image_comparison(baseline_images=['constrained_layout11'], extensions=['png']) def test_constrained_layout11():
64
64
213
26
38
AbdulHoffmann/carla_carissma
PythonAPI/carissma_project/lib/python3.5/site-packages/matplotlib/tests/test_constrainedlayout.py
Python
test_constrained_layout11
test_constrained_layout11
185
202
185
187
80f4e27b2a7508e077a7dfdbfe9726e90960f90b
bigcode/the-stack
train
c46094ae5c81072122cd3fa4
train
function
@image_comparison(baseline_images=['constrained_layout15'], extensions=['png']) def test_constrained_layout15(): 'Test that rcparams work.' rcParams['figure.constrained_layout.use'] = True fig, axs = plt.subplots(2, 2) for ax in axs.flatten(): example_plot(ax, fontsize=12)
@image_comparison(baseline_images=['constrained_layout15'], extensions=['png']) def test_constrained_layout15():
'Test that rcparams work.' rcParams['figure.constrained_layout.use'] = True fig, axs = plt.subplots(2, 2) for ax in axs.flatten(): example_plot(ax, fontsize=12)
fig.set_constrained_layout_pads( w_pad=3./72., h_pad=3./72., hspace=0.2, wspace=0.2) @image_comparison(baseline_images=['constrained_layout15'], extensions=['png']) def test_constrained_layout15():
64
64
76
26
38
AbdulHoffmann/carla_carissma
PythonAPI/carissma_project/lib/python3.5/site-packages/matplotlib/tests/test_constrainedlayout.py
Python
test_constrained_layout15
test_constrained_layout15
273
280
273
275
67bffbf9e8732404d97a305e9436e72baacf2c6f
bigcode/the-stack
train
14aba0d1ddcbcb1762f5075c
train
function
@image_comparison(baseline_images=['constrained_layout11rat'], extensions=['png']) def test_constrained_layout11rat(): 'Test for multiple nested gridspecs with width_ratios' fig = plt.figure(constrained_layout=True, figsize=(10, 3)) gs0 = gridspec.GridSpec(1, 2, figure=fig, width_ratios=[6., 1.]) ...
@image_comparison(baseline_images=['constrained_layout11rat'], extensions=['png']) def test_constrained_layout11rat():
'Test for multiple nested gridspecs with width_ratios' fig = plt.figure(constrained_layout=True, figsize=(10, 3)) gs0 = gridspec.GridSpec(1, 2, figure=fig, width_ratios=[6., 1.]) gsl = gridspec.GridSpecFromSubplotSpec(1, 2, gs0[0]) gsl0 = gridspec.GridSpecFromSubplotSpec(2, 2, gsl[1], he...
=9) fig.colorbar(pcm, ax=axs, shrink=0.6, aspect=70.) ax = fig.add_subplot(gsl[0]) example_plot(ax, fontsize=9) @image_comparison(baseline_images=['constrained_layout11rat'], extensions=['png']) def test_constrained_layout11rat():
72
72
240
28
44
AbdulHoffmann/carla_carissma
PythonAPI/carissma_project/lib/python3.5/site-packages/matplotlib/tests/test_constrainedlayout.py
Python
test_constrained_layout11rat
test_constrained_layout11rat
205
223
205
207
af4d9a83ada66e55807a124fc1ce5fce74e47efb
bigcode/the-stack
train
8c84aef0867bca478ff6ffbe
train
function
def test_constrained_layout19(): 'Test twiny' fig, ax = plt.subplots(constrained_layout=True) ax2 = ax.twiny() example_plot(ax) example_plot(ax2, fontsize=24) ax2.set_title('') ax.set_title('') fig.canvas.draw() assert all(ax.get_position().extents == ax2.get_position().extents)
def test_constrained_layout19():
'Test twiny' fig, ax = plt.subplots(constrained_layout=True) ax2 = ax.twiny() example_plot(ax) example_plot(ax2, fontsize=24) ax2.set_title('') ax.set_title('') fig.canvas.draw() assert all(ax.get_position().extents == ax2.get_position().extents)
, ax = plt.subplots(constrained_layout=True) ax2 = ax.twinx() example_plot(ax) example_plot(ax2, fontsize=24) fig.canvas.draw() assert all(ax.get_position().extents == ax2.get_position().extents) def test_constrained_layout19():
64
64
82
7
57
AbdulHoffmann/carla_carissma
PythonAPI/carissma_project/lib/python3.5/site-packages/matplotlib/tests/test_constrainedlayout.py
Python
test_constrained_layout19
test_constrained_layout19
320
329
320
320
1ecc5020f73da9b53045bcf9443f79644f7e9177
bigcode/the-stack
train
134f9ab9c02aefb2378cb94e
train
function
def test_constrained_layout7(): 'Test for proper warning if fig not set in GridSpec' with pytest.warns(UserWarning, match='Calling figure.constrained_layout, ' 'but figure not setup to do constrained layout'): fig = plt.figure(constrained_layout=True) gs = gridspec.Gr...
def test_constrained_layout7():
'Test for proper warning if fig not set in GridSpec' with pytest.warns(UserWarning, match='Calling figure.constrained_layout, ' 'but figure not setup to do constrained layout'): fig = plt.figure(constrained_layout=True) gs = gridspec.GridSpec(1, 2) gsl = grids...
sr += [ax] pcm = example_pcolor(ax, fontsize=12) fig.colorbar(pcm, ax=axsr, pad=0.01, shrink=0.99, location='bottom', ticks=ticker.MaxNLocator(nbins=5)) def test_constrained_layout7():
64
64
153
7
57
AbdulHoffmann/carla_carissma
PythonAPI/carissma_project/lib/python3.5/site-packages/matplotlib/tests/test_constrainedlayout.py
Python
test_constrained_layout7
test_constrained_layout7
117
129
117
117
c4932dbd89973727b3b11de06e8bd00b6b5b0b0d
bigcode/the-stack
train
6958897fce743dab1fae93ba
train
function
@image_comparison(baseline_images=['constrained_layout17'], extensions=['png']) def test_constrained_layout17(): 'Test uneven gridspecs' fig = plt.figure(constrained_layout=True) gs = gridspec.GridSpec(3, 3, figure=fig) ax1 = fig.add_subplot(gs[0, 0]) ax2 = fig.add_subplot(gs[0, 1:]) ax...
@image_comparison(baseline_images=['constrained_layout17'], extensions=['png']) def test_constrained_layout17():
'Test uneven gridspecs' fig = plt.figure(constrained_layout=True) gs = gridspec.GridSpec(3, 3, figure=fig) ax1 = fig.add_subplot(gs[0, 0]) ax2 = fig.add_subplot(gs[0, 1:]) ax3 = fig.add_subplot(gs[1:, 0:2]) ax4 = fig.add_subplot(gs[1:, -1]) example_plot(ax1) example_plot(ax2) e...
=True) example_plot(ax, fontsize=12) ax2 = fig.add_axes([0.2, 0.2, 0.4, 0.4]) @image_comparison(baseline_images=['constrained_layout17'], extensions=['png']) def test_constrained_layout17():
64
64
143
26
38
AbdulHoffmann/carla_carissma
PythonAPI/carissma_project/lib/python3.5/site-packages/matplotlib/tests/test_constrainedlayout.py
Python
test_constrained_layout17
test_constrained_layout17
292
307
292
294
56984a8613766799addd79b58abed4c82672cfd9
bigcode/the-stack
train
0cc59f58c075fcc5ea8b2197
train
function
@image_comparison(baseline_images=['constrained_layout9'], extensions=['png']) def test_constrained_layout9(): 'Test for handling suptitle and for sharex and sharey' fig, axs = plt.subplots(2, 2, constrained_layout=True, sharex=False, sharey=False) for ax in axs.flatten()...
@image_comparison(baseline_images=['constrained_layout9'], extensions=['png']) def test_constrained_layout9():
'Test for handling suptitle and for sharex and sharey' fig, axs = plt.subplots(2, 2, constrained_layout=True, sharex=False, sharey=False) for ax in axs.flatten(): pcm = example_pcolor(ax, fontsize=24) ax.set_xlabel('') ax.set_ylabel('') ax.set_aspect(2...
[ax] pcm = example_pcolor(ax, fontsize=9) fig.colorbar(pcm, ax=axs, pad=0.01, shrink=0.6) @image_comparison(baseline_images=['constrained_layout9'], extensions=['png']) def test_constrained_layout9():
64
64
143
26
38
AbdulHoffmann/carla_carissma
PythonAPI/carissma_project/lib/python3.5/site-packages/matplotlib/tests/test_constrainedlayout.py
Python
test_constrained_layout9
test_constrained_layout9
160
172
160
162
29a0403cd025593409c7765a6f85777a7f68005c
bigcode/the-stack
train
abce51434db0973a6d97e146
train
function
@image_comparison(baseline_images=['constrained_layout10'], extensions=['png']) def test_constrained_layout10(): 'Test for handling legend outside axis' fig, axs = plt.subplots(2, 2, constrained_layout=True) for ax in axs.flatten(): ax.plot(np.arange(12), label='This is a label') ax.lege...
@image_comparison(baseline_images=['constrained_layout10'], extensions=['png']) def test_constrained_layout10():
'Test for handling legend outside axis' fig, axs = plt.subplots(2, 2, constrained_layout=True) for ax in axs.flatten(): ax.plot(np.arange(12), label='This is a label') ax.legend(loc='center left', bbox_to_anchor=(0.8, 0.5))
fig.colorbar(pcm, ax=axs, pad=0.01, shrink=0.6) fig.suptitle('Test Suptitle', fontsize=28) @image_comparison(baseline_images=['constrained_layout10'], extensions=['png']) def test_constrained_layout10():
64
64
95
26
38
AbdulHoffmann/carla_carissma
PythonAPI/carissma_project/lib/python3.5/site-packages/matplotlib/tests/test_constrainedlayout.py
Python
test_constrained_layout10
test_constrained_layout10
175
182
175
177
bf43f84a556c7c2bb3c2a4dec41ca314d8c062e4
bigcode/the-stack
train
396177fd2b79f4cb2c3d401d
train
function
def test_constrained_layout22(): '#11035: suptitle should not be include in CL if manually positioned' fig, ax = plt.subplots(constrained_layout=True) fig.canvas.draw() extents0 = np.copy(ax.get_position().extents) fig.suptitle("Suptitle", y=0.5) fig.canvas.draw() extents1 = np.copy(ax.get...
def test_constrained_layout22():
'#11035: suptitle should not be include in CL if manually positioned' fig, ax = plt.subplots(constrained_layout=True) fig.canvas.draw() extents0 = np.copy(ax.get_position().extents) fig.suptitle("Suptitle", y=0.5) fig.canvas.draw() extents1 = np.copy(ax.get_position().extents) np.test...
extents0 = np.copy(ax.get_position().extents) fig.suptitle("Suptitle1") fig.canvas.draw() extents1 = np.copy(ax.get_position().extents) np.testing.assert_allclose(extents0, extents1) def test_constrained_layout22():
64
64
105
7
57
AbdulHoffmann/carla_carissma
PythonAPI/carissma_project/lib/python3.5/site-packages/matplotlib/tests/test_constrainedlayout.py
Python
test_constrained_layout22
test_constrained_layout22
358
369
358
358
8c92ec9bd330411480a06e30ec675ebc97c4fb54
bigcode/the-stack
train
8e6b7b0c51b7f3da3e2c91c4
train
function
def example_pcolor(ax, fontsize=12): dx, dy = 0.6, 0.6 y, x = np.mgrid[slice(-3, 3 + dy, dy), slice(-3, 3 + dx, dx)] z = (1 - x / 2. + x ** 5 + y ** 3) * np.exp(-x ** 2 - y ** 2) pcm = ax.pcolormesh(x, y, z, cmap='RdBu_r', vmin=-1., vmax=1., rasterized=True) ...
def example_pcolor(ax, fontsize=12):
dx, dy = 0.6, 0.6 y, x = np.mgrid[slice(-3, 3 + dy, dy), slice(-3, 3 + dx, dx)] z = (1 - x / 2. + x ** 5 + y ** 3) * np.exp(-x ** 2 - y ** 2) pcm = ax.pcolormesh(x, y, z, cmap='RdBu_r', vmin=-1., vmax=1., rasterized=True) # ax.locator_params(nbins=3) a...
c: ax.set_xlabel('x-label', fontsize=fontsize) ax.set_ylabel('y-label', fontsize=fontsize) ax.set_title('Title', fontsize=fontsize) else: ax.set_xticklabels('') ax.set_yticklabels('') def example_pcolor(ax, fontsize=12):
63
64
177
10
54
AbdulHoffmann/carla_carissma
PythonAPI/carissma_project/lib/python3.5/site-packages/matplotlib/tests/test_constrainedlayout.py
Python
example_pcolor
example_pcolor
22
33
22
22
eeb6fc8248dc5de731d3120bc4ae72c128131f13
bigcode/the-stack
train
9e4fb1232ac9c7e58bcfbb8a
train
function
def test_constrained_layout20(): 'Smoke test cl does not mess up added axes' gx = np.linspace(-5, 5, 4) img = np.hypot(gx, gx[:, None]) fig = plt.figure() ax = fig.add_axes([0, 0, 1, 1]) mesh = ax.pcolormesh(gx, gx, img) fig.colorbar(mesh)
def test_constrained_layout20():
'Smoke test cl does not mess up added axes' gx = np.linspace(-5, 5, 4) img = np.hypot(gx, gx[:, None]) fig = plt.figure() ax = fig.add_axes([0, 0, 1, 1]) mesh = ax.pcolormesh(gx, gx, img) fig.colorbar(mesh)
ax2 = ax.twiny() example_plot(ax) example_plot(ax2, fontsize=24) ax2.set_title('') ax.set_title('') fig.canvas.draw() assert all(ax.get_position().extents == ax2.get_position().extents) def test_constrained_layout20():
64
64
92
7
57
AbdulHoffmann/carla_carissma
PythonAPI/carissma_project/lib/python3.5/site-packages/matplotlib/tests/test_constrainedlayout.py
Python
test_constrained_layout20
test_constrained_layout20
332
340
332
332
3040a2df44d4538aec18e49b1849d4d48428bc7e
bigcode/the-stack
train
9d252e6614623a240f509747
train
function
@image_comparison(baseline_images=['constrained_layout14'], extensions=['png']) def test_constrained_layout14(): 'Test that padding works.' fig, axs = plt.subplots(2, 2, constrained_layout=True) for ax in axs.flatten(): pcm = example_pcolor(ax, fontsize=12) fig.colorbar(pcm, ax=ax, s...
@image_comparison(baseline_images=['constrained_layout14'], extensions=['png']) def test_constrained_layout14():
'Test that padding works.' fig, axs = plt.subplots(2, 2, constrained_layout=True) for ax in axs.flatten(): pcm = example_pcolor(ax, fontsize=12) fig.colorbar(pcm, ax=ax, shrink=0.6, aspect=20., pad=0.02) fig.set_constrained_layout_pads( w_pad=3./72., h_pad=3./72., ...
=0.6, aspect=20., pad=0.02) fig.set_constrained_layout_pads(w_pad=24./72., h_pad=24./72.) @image_comparison(baseline_images=['constrained_layout14'], extensions=['png']) def test_constrained_layout14():
63
64
134
26
37
AbdulHoffmann/carla_carissma
PythonAPI/carissma_project/lib/python3.5/site-packages/matplotlib/tests/test_constrainedlayout.py
Python
test_constrained_layout14
test_constrained_layout14
260
270
260
262
5eab7deca1bf48a67ace591ee5b65e5130e8106c
bigcode/the-stack
train
b6a22d145c1103e42b299fb7
train
function
@image_comparison(baseline_images=['constrained_layout1'], extensions=['png']) def test_constrained_layout1(): 'Test constrained_layout for a single subplot' fig = plt.figure(constrained_layout=True) ax = fig.add_subplot(111) example_plot(ax, fontsize=24)
@image_comparison(baseline_images=['constrained_layout1'], extensions=['png']) def test_constrained_layout1():
'Test constrained_layout for a single subplot' fig = plt.figure(constrained_layout=True) ax = fig.add_subplot(111) example_plot(ax, fontsize=24)
ax.set_xlabel('x-label', fontsize=fontsize) ax.set_ylabel('y-label', fontsize=fontsize) ax.set_title('Title', fontsize=fontsize) return pcm @image_comparison(baseline_images=['constrained_layout1'], extensions=['png']) def test_constrained_layout1():
64
64
64
26
37
AbdulHoffmann/carla_carissma
PythonAPI/carissma_project/lib/python3.5/site-packages/matplotlib/tests/test_constrainedlayout.py
Python
test_constrained_layout1
test_constrained_layout1
36
42
36
38
624f53ae0db4a5b86e8715e788b51ab8ab8872ee
bigcode/the-stack
train
b9f33c18e6962c19b3521378
train
function
@image_comparison(baseline_images=['constrained_layout2'], extensions=['png']) def test_constrained_layout2(): 'Test constrained_layout for 2x2 subplots' fig, axs = plt.subplots(2, 2, constrained_layout=True) for ax in axs.flatten(): example_plot(ax, fontsize=24)
@image_comparison(baseline_images=['constrained_layout2'], extensions=['png']) def test_constrained_layout2():
'Test constrained_layout for 2x2 subplots' fig, axs = plt.subplots(2, 2, constrained_layout=True) for ax in axs.flatten(): example_plot(ax, fontsize=24)
'Test constrained_layout for a single subplot' fig = plt.figure(constrained_layout=True) ax = fig.add_subplot(111) example_plot(ax, fontsize=24) @image_comparison(baseline_images=['constrained_layout2'], extensions=['png']) def test_constrained_layout2():
64
64
72
26
38
AbdulHoffmann/carla_carissma
PythonAPI/carissma_project/lib/python3.5/site-packages/matplotlib/tests/test_constrainedlayout.py
Python
test_constrained_layout2
test_constrained_layout2
45
51
45
47
b1855389ba50cc0e1ae7612ff9d3c86b1f0726ae
bigcode/the-stack
train
a3d94c50c7dcf160ff82981b
train
function
@image_comparison(baseline_images=['constrained_layout8'], extensions=['png']) def test_constrained_layout8(): 'Test for gridspecs that are not completely full' fig = plt.figure(figsize=(10, 5), constrained_layout=True) gs = gridspec.GridSpec(3, 5, figure=fig) axs = [] for j in [0, 1]: ...
@image_comparison(baseline_images=['constrained_layout8'], extensions=['png']) def test_constrained_layout8():
'Test for gridspecs that are not completely full' fig = plt.figure(figsize=(10, 5), constrained_layout=True) gs = gridspec.GridSpec(3, 5, figure=fig) axs = [] for j in [0, 1]: if j == 0: ilist = [1] else: ilist = [0, 4] for i in ilist: ax =...
, gs[1]) axsl = [] for gs in gsl: ax = fig.add_subplot(gs) # need to trigger a draw to get warning fig.draw(fig.canvas.get_renderer()) @image_comparison(baseline_images=['constrained_layout8'], extensions=['png']) def test_constrained_layout8():
69
69
231
26
43
AbdulHoffmann/carla_carissma
PythonAPI/carissma_project/lib/python3.5/site-packages/matplotlib/tests/test_constrainedlayout.py
Python
test_constrained_layout8
test_constrained_layout8
132
157
132
134
c63c3baa56fdcb3229d145f8fa917b589ec06283
bigcode/the-stack
train
5bb197900077e6f88ff832e1
train
function
def test_constrained_layout23(): ''' Comment in #11035: suptitle used to cause an exception when reusing a figure w/ CL with ``clear=True``. ''' for i in range(2): fig, ax = plt.subplots(num="123", constrained_layout=True, clear=True) fig.suptitle("Suptitle{}".format(i))
def test_constrained_layout23():
''' Comment in #11035: suptitle used to cause an exception when reusing a figure w/ CL with ``clear=True``. ''' for i in range(2): fig, ax = plt.subplots(num="123", constrained_layout=True, clear=True) fig.suptitle("Suptitle{}".format(i))
.copy(ax.get_position().extents) fig.suptitle("Suptitle", y=0.5) fig.canvas.draw() extents1 = np.copy(ax.get_position().extents) np.testing.assert_allclose(extents0, extents1) def test_constrained_layout23():
64
64
81
7
57
AbdulHoffmann/carla_carissma
PythonAPI/carissma_project/lib/python3.5/site-packages/matplotlib/tests/test_constrainedlayout.py
Python
test_constrained_layout23
test_constrained_layout23
372
380
372
372
a9bfcb82d771f42f3a1c3461d0937b88d0322ed3
bigcode/the-stack
train
dc4c251c35c4aca796986bf8
train
function
def test_constrained_layout21(): '#11035: repeated calls to suptitle should not alter the layout' fig, ax = plt.subplots(constrained_layout=True) fig.suptitle("Suptitle0") fig.canvas.draw() extents0 = np.copy(ax.get_position().extents) fig.suptitle("Suptitle1") fig.canvas.draw() extent...
def test_constrained_layout21():
'#11035: repeated calls to suptitle should not alter the layout' fig, ax = plt.subplots(constrained_layout=True) fig.suptitle("Suptitle0") fig.canvas.draw() extents0 = np.copy(ax.get_position().extents) fig.suptitle("Suptitle1") fig.canvas.draw() extents1 = np.copy(ax.get_position().ex...
= np.hypot(gx, gx[:, None]) fig = plt.figure() ax = fig.add_axes([0, 0, 1, 1]) mesh = ax.pcolormesh(gx, gx, img) fig.colorbar(mesh) def test_constrained_layout21():
64
64
110
7
57
AbdulHoffmann/carla_carissma
PythonAPI/carissma_project/lib/python3.5/site-packages/matplotlib/tests/test_constrainedlayout.py
Python
test_constrained_layout21
test_constrained_layout21
343
355
343
343
ca74d440463c4f906036f1ff4bb3351df7402b9f
bigcode/the-stack
train
9ecb178259d91c1288b69734
train
function
@image_comparison(baseline_images=['constrained_layout3'], extensions=['png']) def test_constrained_layout3(): 'Test constrained_layout for colorbars with subplots' fig, axs = plt.subplots(2, 2, constrained_layout=True) for nn, ax in enumerate(axs.flatten()): pcm = example_pcolor(ax, fontsiz...
@image_comparison(baseline_images=['constrained_layout3'], extensions=['png']) def test_constrained_layout3():
'Test constrained_layout for colorbars with subplots' fig, axs = plt.subplots(2, 2, constrained_layout=True) for nn, ax in enumerate(axs.flatten()): pcm = example_pcolor(ax, fontsize=24) if nn == 3: pad = 0.08 else: pad = 0.02 # default fig.colorbar(p...
x2 subplots' fig, axs = plt.subplots(2, 2, constrained_layout=True) for ax in axs.flatten(): example_plot(ax, fontsize=24) @image_comparison(baseline_images=['constrained_layout3'], extensions=['png']) def test_constrained_layout3():
64
64
121
26
38
AbdulHoffmann/carla_carissma
PythonAPI/carissma_project/lib/python3.5/site-packages/matplotlib/tests/test_constrainedlayout.py
Python
test_constrained_layout3
test_constrained_layout3
54
65
54
56
3de2a4db3875b009582fb0bba6c367eb1f163811
bigcode/the-stack
train
aa3c6a360b8cd00eb667bb29
train
function
@image_comparison(baseline_images=['constrained_layout5'], tol=5.e-2, extensions=['png']) def test_constrained_layout5(): ''' Test constrained_layout for a single colorbar with subplots, colorbar bottom ''' fig, axs = plt.subplots(2, 2, constrained_layout=True) for ax in axs.fl...
@image_comparison(baseline_images=['constrained_layout5'], tol=5.e-2, extensions=['png']) def test_constrained_layout5():
''' Test constrained_layout for a single colorbar with subplots, colorbar bottom ''' fig, axs = plt.subplots(2, 2, constrained_layout=True) for ax in axs.flatten(): pcm = example_pcolor(ax, fontsize=24) fig.colorbar(pcm, ax=axs, use_gridspec=False, pad=0.01, shrink=0...
_pcolor(ax, fontsize=24) fig.colorbar(pcm, ax=axs, pad=0.01, shrink=0.6) @image_comparison(baseline_images=['constrained_layout5'], tol=5.e-2, extensions=['png']) def test_constrained_layout5():
64
64
126
33
31
AbdulHoffmann/carla_carissma
PythonAPI/carissma_project/lib/python3.5/site-packages/matplotlib/tests/test_constrainedlayout.py
Python
test_constrained_layout5
test_constrained_layout5
77
89
77
79
9d22be21b84882c7bedfb13227118473d817bced
bigcode/the-stack
train
8df6e1f08b89fd405a73c5ab
train
function
def test_constrained_layout18(): 'Test twinx' fig, ax = plt.subplots(constrained_layout=True) ax2 = ax.twinx() example_plot(ax) example_plot(ax2, fontsize=24) fig.canvas.draw() assert all(ax.get_position().extents == ax2.get_position().extents)
def test_constrained_layout18():
'Test twinx' fig, ax = plt.subplots(constrained_layout=True) ax2 = ax.twinx() example_plot(ax) example_plot(ax2, fontsize=24) fig.canvas.draw() assert all(ax.get_position().extents == ax2.get_position().extents)
1:]) ax3 = fig.add_subplot(gs[1:, 0:2]) ax4 = fig.add_subplot(gs[1:, -1]) example_plot(ax1) example_plot(ax2) example_plot(ax3) example_plot(ax4) def test_constrained_layout18():
64
64
72
7
57
AbdulHoffmann/carla_carissma
PythonAPI/carissma_project/lib/python3.5/site-packages/matplotlib/tests/test_constrainedlayout.py
Python
test_constrained_layout18
test_constrained_layout18
310
317
310
310
ab02721e03b6fc458a4a96de0bafe8bc702ef8d7
bigcode/the-stack
train
73f9da8d341e40d401e76a08
train
function
@pytest.mark.timeout(30) @pytest.mark.flaky(reruns=3) @image_comparison(baseline_images=['test_colorbar_location'], extensions=['png'], remove_text=True, style='mpl20') def test_colorbar_location(): """ Test that colorbar handling is as expected for various complicated cases... """ fig, axs...
@pytest.mark.timeout(30) @pytest.mark.flaky(reruns=3) @image_comparison(baseline_images=['test_colorbar_location'], extensions=['png'], remove_text=True, style='mpl20') def test_colorbar_location():
""" Test that colorbar handling is as expected for various complicated cases... """ fig, axs = plt.subplots(4, 5, constrained_layout=True) for ax in axs.flatten(): pcm = example_pcolor(ax) ax.set_xlabel('') ax.set_ylabel('') fig.colorbar(pcm, ax=axs[:, 1], shrink=0.4...
we mark as # flaky. Apparently the constraint solver occasionally doesn't fully # optimize. Would be nice if this were more deterministic... @pytest.mark.timeout(30) @pytest.mark.flaky(reruns=3) @image_comparison(baseline_images=['test_colorbar_location'], extensions=['png'], remove_text=True, style='mpl20')...
79
79
264
50
29
AbdulHoffmann/carla_carissma
PythonAPI/carissma_project/lib/python3.5/site-packages/matplotlib/tests/test_constrainedlayout.py
Python
test_colorbar_location
test_colorbar_location
386
406
386
390
7ad1cc8122a13bfe58989cf43bece518deebfd7f
bigcode/the-stack
train
a5b4cff13e84de02a2eaea62
train
function
@image_comparison(baseline_images=['constrained_layout16'], extensions=['png']) def test_constrained_layout16(): 'Test ax.set_position.' fig, ax = plt.subplots(constrained_layout=True) example_plot(ax, fontsize=12) ax2 = fig.add_axes([0.2, 0.2, 0.4, 0.4])
@image_comparison(baseline_images=['constrained_layout16'], extensions=['png']) def test_constrained_layout16():
'Test ax.set_position.' fig, ax = plt.subplots(constrained_layout=True) example_plot(ax, fontsize=12) ax2 = fig.add_axes([0.2, 0.2, 0.4, 0.4])
figure.constrained_layout.use'] = True fig, axs = plt.subplots(2, 2) for ax in axs.flatten(): example_plot(ax, fontsize=12) @image_comparison(baseline_images=['constrained_layout16'], extensions=['png']) def test_constrained_layout16():
64
64
81
26
38
AbdulHoffmann/carla_carissma
PythonAPI/carissma_project/lib/python3.5/site-packages/matplotlib/tests/test_constrainedlayout.py
Python
test_constrained_layout16
test_constrained_layout16
283
289
283
285
c305d778b00c5f673be6135fb91630a0730e6449
bigcode/the-stack
train
82226b2c08eb9a5178fa7904
train
function
@image_comparison(baseline_images=['constrained_layout13'], tol=2.e-2, extensions=['png']) def test_constrained_layout13(): 'Test that padding works.' fig, axs = plt.subplots(2, 2, constrained_layout=True) for ax in axs.flatten(): pcm = example_pcolor(ax, fontsize=12) fig.colorbar(pc...
@image_comparison(baseline_images=['constrained_layout13'], tol=2.e-2, extensions=['png']) def test_constrained_layout13():
'Test that padding works.' fig, axs = plt.subplots(2, 2, constrained_layout=True) for ax in axs.flatten(): pcm = example_pcolor(ax, fontsize=12) fig.colorbar(pcm, ax=ax, shrink=0.6, aspect=20., pad=0.02) fig.set_constrained_layout_pads(w_pad=24./72., h_pad=24./72.)
ax = fig.add_subplot(gs0[4:, 0]) example_plot(ax, nodec=True) ax.set_xlabel('x-label') @image_comparison(baseline_images=['constrained_layout13'], tol=2.e-2, extensions=['png']) def test_constrained_layout13():
64
64
124
33
31
AbdulHoffmann/carla_carissma
PythonAPI/carissma_project/lib/python3.5/site-packages/matplotlib/tests/test_constrainedlayout.py
Python
test_constrained_layout13
test_constrained_layout13
249
257
249
251
76919ae398b93a4949acf0a827a66e9dfe28db6d
bigcode/the-stack
train
1dfbdf4722ba259026ec7260
train
function
@image_comparison(baseline_images=['constrained_layout6'], extensions=['png']) def test_constrained_layout6(): 'Test constrained_layout for nested gridspecs' fig = plt.figure(constrained_layout=True) gs = fig.add_gridspec(1, 2, figure=fig) gsl = gs[0].subgridspec(2, 2) gsr = gs[1].subgridspe...
@image_comparison(baseline_images=['constrained_layout6'], extensions=['png']) def test_constrained_layout6():
'Test constrained_layout for nested gridspecs' fig = plt.figure(constrained_layout=True) gs = fig.add_gridspec(1, 2, figure=fig) gsl = gs[0].subgridspec(2, 2) gsr = gs[1].subgridspec(1, 2) axsl = [] for gs in gsl: ax = fig.add_subplot(gs) axsl += [ax] example_plot(ax,...
(ax, fontsize=24) fig.colorbar(pcm, ax=axs, use_gridspec=False, pad=0.01, shrink=0.6, location='bottom') @image_comparison(baseline_images=['constrained_layout6'], extensions=['png']) def test_constrained_layout6():
67
67
225
26
41
AbdulHoffmann/carla_carissma
PythonAPI/carissma_project/lib/python3.5/site-packages/matplotlib/tests/test_constrainedlayout.py
Python
test_constrained_layout6
test_constrained_layout6
92
114
92
94
b76d787558339f207d1e30b5c294c25b5a36ce7e
bigcode/the-stack
train
23f71d78d1df8adb6cd02368
train
function
def example_plot(ax, fontsize=12, nodec=False): ax.plot([1, 2]) ax.locator_params(nbins=3) if not nodec: ax.set_xlabel('x-label', fontsize=fontsize) ax.set_ylabel('y-label', fontsize=fontsize) ax.set_title('Title', fontsize=fontsize) else: ax.set_xticklabels('') a...
def example_plot(ax, fontsize=12, nodec=False):
ax.plot([1, 2]) ax.locator_params(nbins=3) if not nodec: ax.set_xlabel('x-label', fontsize=fontsize) ax.set_ylabel('y-label', fontsize=fontsize) ax.set_title('Title', fontsize=fontsize) else: ax.set_xticklabels('') ax.set_yticklabels('')
import numpy as np import pytest from matplotlib.testing.decorators import image_comparison import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec from matplotlib import ticker, rcParams def example_plot(ax, fontsize=12, nodec=False):
53
64
89
13
39
AbdulHoffmann/carla_carissma
PythonAPI/carissma_project/lib/python3.5/site-packages/matplotlib/tests/test_constrainedlayout.py
Python
example_plot
example_plot
10
19
10
10
fcb080984119b1897b9b8258b172cb69e7a8c965
bigcode/the-stack
train
2095207f304a8ad786ea6113
train
class
class NetApps(Menu): name = "Network" keywords = KwS( Network, Dialup, InstantMessaging, IRCClient, FileTransfer, HamRadio, News, Email, P2P, RemoteAccess, Telephony, WebBrowser)
class NetApps(Menu):
name = "Network" keywords = KwS( Network, Dialup, InstantMessaging, IRCClient, FileTransfer, HamRadio, News, Email, P2P, RemoteAccess, Telephony, WebBrowser)
init__([x([]) for x in subs]) class Multimedia(Menu): name = "Multimedia" keywords = KwS(AudioVideo, Audio, Midi, Mixer, Sequencer, Tuner, Video, TV, AudioVideoEditing, Player, Recorder, DiscBurning) class NetApps(Menu):
64
64
63
5
59
zen0bit/menumaker
MenuMaker/__init__.py
Python
NetApps
NetApps
427
441
427
427
ed3dd2458d63d6d7c2325564b393abd02776729d
bigcode/the-stack
train
8f451068d906d91ec2461f9e
train
class
class GNOMESettings(Menu): name = "GNOME" keywords = KwS(GNOME, Settings) def suitable(self, app): return len(app.keywords & self.keywords) == 2
class GNOMESettings(Menu):
name = "GNOME" keywords = KwS(GNOME, Settings) def suitable(self, app): return len(app.keywords & self.keywords) == 2
" keywords = KwS( Utility, Accessibility, Calculator, Clock, Applet, Archiving, TrayIcon) # KDE-specific keywords #XKM = Kw("X-KDE-More") #XKI = Kw("X-KDE-information") # class GNOMESettings(Menu):
63
64
47
7
56
zen0bit/menumaker
MenuMaker/__init__.py
Python
GNOMESettings
GNOMESettings
267
272
267
267
a7498bf8dacc5aff77746947b0953326986568ea
bigcode/the-stack
train
8b3851b4f9a96ad6446ed230
train
class
class KDevelop(Menu): name = "KDevelop" def suitable(self, app): return fnmatch.fnmatch(app.name, "*KDevelop*")
class KDevelop(Menu):
name = "KDevelop" def suitable(self, app): return fnmatch.fnmatch(app.name, "*KDevelop*")
for x in subs]) def suitable(self, app): return True def _menu(id, kws): class _Menu(Menu): name = id def suitable(self, app): return len(app.keywords & kws) > 0 return _Menu class KDevelop(Menu):
64
64
33
5
58
zen0bit/menumaker
MenuMaker/__init__.py
Python
KDevelop
KDevelop
220
224
220
220
df26c2dea2b22c830dbd7839c6e88f072f9099b1
bigcode/the-stack
train
d0e747d41eb3a6b413acc4f4
train
class
class Edutainment(Menu): name = "Education" keywords = KwS(Education, Art, Construction, Music, Languages, Teaching)
class Edutainment(Menu):
name = "Education" keywords = KwS(Education, Art, Construction, Music, Languages, Teaching)
super(SystemApps, self).__init__([x([]) for x in subs]) class ScienceApps(Menu): name = "Science" keywords = KwS(Electronics, Engineering, Science, Astronomy, Biology, Chemistry, Geology, Math, MedicalSoftware, Physics) class Edutainment(Menu):
64
64
30
6
58
zen0bit/menumaker
MenuMaker/__init__.py
Python
Edutainment
Edutainment
345
347
345
345
f3a28e9d90a87d81c01db8797e9fe2eb64b8a427
bigcode/the-stack
train
b19a98bb196a340d0b5d43fe
train
class
class Entry(object): """Basic menu class""" # Alignment specifiers Floating = 0 # Element is subject to sorting # Element should be placed at the menu top retaining the original order StickTop = 1 StickBottom = 2 # ...at the bottom... def __init__(self): self.align = Entry.Floati...
class Entry(object):
"""Basic menu class""" # Alignment specifiers Floating = 0 # Element is subject to sorting # Element should be placed at the menu top retaining the original order StickTop = 1 StickBottom = 2 # ...at the bottom... def __init__(self): self.align = Entry.Floating
def setFrontend(module): """Specify the frontend to use""" for x in (Entry, Sep, App, Menu, Root): try: x.__bases__ = (getattr(module, x.__name__),) + x.__bases__ except AttributeError: pass class Entry(object):
64
64
79
4
59
zen0bit/menumaker
MenuMaker/__init__.py
Python
Entry
Entry
84
94
84
85
becc65178f9b5683007f5eb98cba02359cb65f82
bigcode/the-stack
train
fea7b0a89a62d365f96fb030
train
class
class OfficeApps(Menu): name = "Office" keywords = KwS( Office, Calendar, ContactManagement, Database, Dictionary, Chart, Finance, FlowChart, PDA, ProjectManagement, Presentation, Spreadsheet, WordProcessor)
class OfficeApps(Menu):
name = "Office" keywords = KwS( Office, Calendar, ContactManagement, Database, Dictionary, Chart, Finance, FlowChart, PDA, ProjectManagement, Presentation, Spreadsheet, WordProcessor)
2P, RemoteAccess, Telephony, WebBrowser) class GraphicApps(Menu): name = "Graphics" keywords = KwS(Graphics, x2DGraphics, x3DGraphics, VectorGraphics, RasterGraphics, Scanning, OCR, Photograph, Viewer) class OfficeApps(Menu):
64
64
60
5
59
zen0bit/menumaker
MenuMaker/__init__.py
Python
OfficeApps
OfficeApps
450
465
450
450
341ef562039b7fbfe0d1000633c658ad84f7c285
bigcode/the-stack
train
891a0c5c00e45dc866440f21
train
class
class SystemSettings(Menu): name = "Settings" keywords = KwS(Settings, DesktopSettings, HardwareSettings, Screensaver) def __init__(self, subs): subs = [GNOMESettings, KDESettings, XfceSettings] super(SystemSettings, self).__init__([x([]) for x in subs])
class SystemSettings(Menu):
name = "Settings" keywords = KwS(Settings, DesktopSettings, HardwareSettings, Screensaver) def __init__(self, subs): subs = [GNOMESettings, KDESettings, XfceSettings] super(SystemSettings, self).__init__([x([]) for x in subs])
"X-KDE-settings*"): return True return False class XfceSettings(Menu): name = "Xfce" def suitable(self, app): return len(app.keywords & KwS(Settings, Kw("X-XFCE"))) == 2 class SystemSettings(Menu):
64
64
72
5
58
zen0bit/menumaker
MenuMaker/__init__.py
Python
SystemSettings
SystemSettings
321
327
321
321
6fd28603fe40a9bb99121784715c278d3360fc36
bigcode/the-stack
train
3961911fb8f5ec66b527151e
train
class
class Menu(Entry, list): """Class which may contain other (sub)menus and single entries""" def __init__(self, subs): super(Menu, self).__init__() self[:] = subs def distribute(self, apps): """Distribute the application entries among the menu's submenus and then try to place the ...
class Menu(Entry, list):
"""Class which may contain other (sub)menus and single entries""" def __init__(self, subs): super(Menu, self).__init__() self[:] = subs def distribute(self, apps): """Distribute the application entries among the menu's submenus and then try to place the rest into itself...
Basic menu class""" # Alignment specifiers Floating = 0 # Element is subject to sorting # Element should be placed at the menu top retaining the original order StickTop = 1 StickBottom = 2 # ...at the bottom... def __init__(self): self.align = Entry.Floating class Sep(Entry): "...
146
146
487
7
138
zen0bit/menumaker
MenuMaker/__init__.py
Python
Menu
Menu
115
188
115
116
71fb0eac2a40c4a902b0f7b1c23a3aae6036689c
bigcode/the-stack
train
0f8ed4508b8dc9859b2d093a
train
function
def _kdeMenu(id, kws): class _Menu(Menu): name = id def suitable(self, app): return len( app.keywords & KwS(KDE, "X-KDE-settings")) and len(app.keywords & kws) return _Menu
def _kdeMenu(id, kws):
class _Menu(Menu): name = id def suitable(self, app): return len( app.keywords & KwS(KDE, "X-KDE-settings")) and len(app.keywords & kws) return _Menu
("X-KDE-information") # class GNOMESettings(Menu): name = "GNOME" keywords = KwS(GNOME, Settings) def suitable(self, app): return len(app.keywords & self.keywords) == 2 def _kdeMenu(id, kws):
64
64
60
9
54
zen0bit/menumaker
MenuMaker/__init__.py
Python
_kdeMenu
_kdeMenu
275
283
275
275
2c370081ef7f5caa82a41da0fe0cb177b7ff79ae
bigcode/the-stack
train
3143a8848354fa131fff0302
train
class
class Games(Menu): name = "Games" keywords = KwS( Amusement, Game, ActionGame, AdventureGame, ArcadeGame, BoardGame, BlocksGame, CardGame, KidsGame, LogicGame, RolePlaying, Simulation, SportsGame, Str...
class Games(Menu):
name = "Games" keywords = KwS( Amusement, Game, ActionGame, AdventureGame, ArcadeGame, BoardGame, BlocksGame, CardGame, KidsGame, LogicGame, RolePlaying, Simulation, SportsGame, StrategyGame) def...
): name = "Sports" keywords = KwS(SportsGame) class StrategyGames(Menu): name = "Strategy" keywords = KwS(StrategyGame) class ToyGames(Menu): name = "Amusement" keywords = KwS(Amusement, KidsGame) class Games(Menu):
64
64
132
4
60
zen0bit/menumaker
MenuMaker/__init__.py
Python
Games
Games
395
418
395
395
7e0348765626ea8ff5446f5ba03816f9cc9f5bdb
bigcode/the-stack
train
c4abf531eb47c2f7022460a1
train
class
class Multimedia(Menu): name = "Multimedia" keywords = KwS(AudioVideo, Audio, Midi, Mixer, Sequencer, Tuner, Video, TV, AudioVideoEditing, Player, Recorder, DiscBurning)
class Multimedia(Menu):
name = "Multimedia" keywords = KwS(AudioVideo, Audio, Midi, Mixer, Sequencer, Tuner, Video, TV, AudioVideoEditing, Player, Recorder, DiscBurning)
__init__(self, subs): subs = [ AdventureGames, ArcadeGames, BoardGames, CardGames, PuzzleGames, SimGames, SportsGames, StrategyGames, ToyGames ] super(Games, self).__init__([x([]) for x in subs]) class Multimedia(Menu):
64
64
48
4
60
zen0bit/menumaker
MenuMaker/__init__.py
Python
Multimedia
Multimedia
421
424
421
421
a16bfd287ed0bbaeb27b7c17e99ac948add599af
bigcode/the-stack
train
be3281a9bf5e1ca38b8fafb2
train
class
class Editors(Menu): name = "Editors" keywords = KwS(TextEditor)
class Editors(Menu):
name = "Editors" keywords = KwS(TextEditor)
Development, Building, Debugger, IDE, GUIDesigner, Profiling, RevisionControl, Translation, WebDevelopment) def __init__(self, subs): subs = [KDevelop] super(DevApps, self).__init__([x([]) for x in subs]) class Editors(Menu):
64
64
18
4
60
zen0bit/menumaker
MenuMaker/__init__.py
Python
Editors
Editors
237
239
237
237
a26c6a121a16efbc8dc1d3e43a90d0ce075ddf68
bigcode/the-stack
train
29c642c6544be28f11922496
train
class
class Utils(Menu): name = "Utilities" keywords = KwS( Utility, Accessibility, Calculator, Clock, Applet, Archiving, TrayIcon)
class Utils(Menu):
name = "Utilities" keywords = KwS( Utility, Accessibility, Calculator, Clock, Applet, Archiving, TrayIcon)
(Menu): """Menu that contains the entries that didn't fit elsewhere""" name = "Other" def suitable(self, app): return True class Shells(Menu): name = "Shells" keywords = KwS(Shell, TerminalEmulator, FileManager, Emulator) class Utils(Menu):
64
64
34
4
60
zen0bit/menumaker
MenuMaker/__init__.py
Python
Utils
Utils
256
259
256
256
ce2d87412f9e3732dc49b659859b01f45c2015ab
bigcode/the-stack
train
413d077951938eb443d72ed9
train
class
class GraphicApps(Menu): name = "Graphics" keywords = KwS(Graphics, x2DGraphics, x3DGraphics, VectorGraphics, RasterGraphics, Scanning, OCR, Photograph, Viewer)
class GraphicApps(Menu):
name = "Graphics" keywords = KwS(Graphics, x2DGraphics, x3DGraphics, VectorGraphics, RasterGraphics, Scanning, OCR, Photograph, Viewer)
): name = "Network" keywords = KwS( Network, Dialup, InstantMessaging, IRCClient, FileTransfer, HamRadio, News, Email, P2P, RemoteAccess, Telephony, WebBrowser) class GraphicApps(Menu):
64
64
44
5
59
zen0bit/menumaker
MenuMaker/__init__.py
Python
GraphicApps
GraphicApps
444
447
444
444
7f07fc9972b9472e028e6647040652b82325b34f
bigcode/the-stack
train
ce6f0f750dd76e2c0aac62ac
train
class
class PuzzleGames(Menu): name = "Puzzle" keywords = KwS(LogicGame, BlocksGame)
class PuzzleGames(Menu):
name = "Puzzle" keywords = KwS(LogicGame, BlocksGame)
): name = "Arcade" keywords = KwS(ArcadeGame, ActionGame) class BoardGames(Menu): name = "Board" keywords = KwS(BoardGame) class CardGames(Menu): name = "Card" keywords = KwS(CardGame) class PuzzleGames(Menu):
64
64
23
5
59
zen0bit/menumaker
MenuMaker/__init__.py
Python
PuzzleGames
PuzzleGames
370
372
370
370
163702c65c31b364603d3c3894cfc62f14049a26
bigcode/the-stack
train
a8dffd6a5b57113cc8a6041d
train
class
class XfceSettings(Menu): name = "Xfce" def suitable(self, app): return len(app.keywords & KwS(Settings, Kw("X-XFCE"))) == 2
class XfceSettings(Menu):
name = "Xfce" def suitable(self, app): return len(app.keywords & KwS(Settings, Kw("X-XFCE"))) == 2
, self).__init__([_kdeMenu(*x)([]) for x in subs]) def suitable(self, app): for x in app.keywords: if fnmatch.fnmatch(x, "X-KDE-settings*"): return True return False class XfceSettings(Menu):
64
64
44
7
56
zen0bit/menumaker
MenuMaker/__init__.py
Python
XfceSettings
XfceSettings
314
318
314
314
1e0a394005dff8aaf2b67192977e584e04d201e8
bigcode/the-stack
train
596154b9dc25f62d929e4125
train
class
class SportsGames(Menu): name = "Sports" keywords = KwS(SportsGame)
class SportsGames(Menu):
name = "Sports" keywords = KwS(SportsGame)
Games(Menu): name = "Card" keywords = KwS(CardGame) class PuzzleGames(Menu): name = "Puzzle" keywords = KwS(LogicGame, BlocksGame) class SimGames(Menu): name = "Simulation" keywords = KwS(Simulation) class SportsGames(Menu):
64
64
20
5
59
zen0bit/menumaker
MenuMaker/__init__.py
Python
SportsGames
SportsGames
380
382
380
380
07f0c4e5d4ab9b0c32fdf82e127f4080034fe298
bigcode/the-stack
train
53186408c04635d7114a4b26
train
class
class DevApps(Menu): name = "Development" keywords = KwS(Development, Building, Debugger, IDE, GUIDesigner, Profiling, RevisionControl, Translation, WebDevelopment) def __init__(self, subs): subs = [KDevelop] super(DevApps, self).__init__([x([]) for x in subs])
class DevApps(Menu):
name = "Development" keywords = KwS(Development, Building, Debugger, IDE, GUIDesigner, Profiling, RevisionControl, Translation, WebDevelopment) def __init__(self, subs): subs = [KDevelop] super(DevApps, self).__init__([x([]) for x in subs])
def suitable(self, app): return len(app.keywords & kws) > 0 return _Menu class KDevelop(Menu): name = "KDevelop" def suitable(self, app): return fnmatch.fnmatch(app.name, "*KDevelop*") class DevApps(Menu):
64
64
77
5
59
zen0bit/menumaker
MenuMaker/__init__.py
Python
DevApps
DevApps
227
234
227
227
7b4967f3eb0ff7c899934fdb4075c335698a8832
bigcode/the-stack
train
56107ed2445fbe416afa4af9
train
class
class CardGames(Menu): name = "Card" keywords = KwS(CardGame)
class CardGames(Menu):
name = "Card" keywords = KwS(CardGame)
"Adventure" keywords = KwS(AdventureGame, RolePlaying) class ArcadeGames(Menu): name = "Arcade" keywords = KwS(ArcadeGame, ActionGame) class BoardGames(Menu): name = "Board" keywords = KwS(BoardGame) class CardGames(Menu):
64
64
19
5
59
zen0bit/menumaker
MenuMaker/__init__.py
Python
CardGames
CardGames
365
367
365
365
fd5ff8a983f9d66f0f98c28f1827d8792908b87e
bigcode/the-stack
train
b935dad011eba66d0a2032ae
train
class
class SystemApps(Menu): name = "System" keywords = KwS(System, Filesystem, Monitor, Security, PackageManager) def __init__(self, subs): subs = [_menu("Information", KwS("X-KDE-information")), SystemSettings] super(SystemApps, self).__init__([x([]) for x in subs])
class SystemApps(Menu):
name = "System" keywords = KwS(System, Filesystem, Monitor, Security, PackageManager) def __init__(self, subs): subs = [_menu("Information", KwS("X-KDE-information")), SystemSettings] super(SystemApps, self).__init__([x([]) for x in subs])
= KwS(Settings, DesktopSettings, HardwareSettings, Screensaver) def __init__(self, subs): subs = [GNOMESettings, KDESettings, XfceSettings] super(SystemSettings, self).__init__([x([]) for x in subs]) class SystemApps(Menu):
64
64
74
5
59
zen0bit/menumaker
MenuMaker/__init__.py
Python
SystemApps
SystemApps
330
336
330
330
99d57142fd17e245743cfd60d46c1f944210657d
bigcode/the-stack
train
96609ff87bc857013a70ce5e
train
class
class Shells(Menu): name = "Shells" keywords = KwS(Shell, TerminalEmulator, FileManager, Emulator)
class Shells(Menu):
name = "Shells" keywords = KwS(Shell, TerminalEmulator, FileManager, Emulator)
x([]) for x in subs]) class Editors(Menu): name = "Editors" keywords = KwS(TextEditor) class Misc(Menu): """Menu that contains the entries that didn't fit elsewhere""" name = "Other" def suitable(self, app): return True class Shells(Menu):
64
64
29
5
58
zen0bit/menumaker
MenuMaker/__init__.py
Python
Shells
Shells
251
253
251
251
6b8b9d5a5425095615a1d61ec7ab335e7508fc2e
bigcode/the-stack
train
36c0c770c7e9862491000ab4
train
class
class ScienceApps(Menu): name = "Science" keywords = KwS(Electronics, Engineering, Science, Astronomy, Biology, Chemistry, Geology, Math, MedicalSoftware, Physics)
class ScienceApps(Menu):
name = "Science" keywords = KwS(Electronics, Engineering, Science, Astronomy, Biology, Chemistry, Geology, Math, MedicalSoftware, Physics)
S(System, Filesystem, Monitor, Security, PackageManager) def __init__(self, subs): subs = [_menu("Information", KwS("X-KDE-information")), SystemSettings] super(SystemApps, self).__init__([x([]) for x in subs]) class ScienceApps(Menu):
64
64
41
5
59
zen0bit/menumaker
MenuMaker/__init__.py
Python
ScienceApps
ScienceApps
339
342
339
339
01d53096fde4317ec3be3d5d60198540eee883ff
bigcode/the-stack
train
650afdd56138e6b95a465f76
train
class
class Misc(Menu): """Menu that contains the entries that didn't fit elsewhere""" name = "Other" def suitable(self, app): return True
class Misc(Menu):
"""Menu that contains the entries that didn't fit elsewhere""" name = "Other" def suitable(self, app): return True
Control, Translation, WebDevelopment) def __init__(self, subs): subs = [KDevelop] super(DevApps, self).__init__([x([]) for x in subs]) class Editors(Menu): name = "Editors" keywords = KwS(TextEditor) class Misc(Menu):
64
64
33
4
60
zen0bit/menumaker
MenuMaker/__init__.py
Python
Misc
Misc
242
248
242
243
1f50408525f14b7487f9b9b6b3b8fd64391ceb16
bigcode/the-stack
train
c0866927ff786a273f71020f
train
class
class App(Entry): """Application entry""" def __init__(self, app): super(App, self).__init__() self.name = app.name self.app = app
class App(Entry):
"""Application entry""" def __init__(self, app): super(App, self).__init__() self.name = app.name self.app = app
Top = 1 StickBottom = 2 # ...at the bottom... def __init__(self): self.align = Entry.Floating class Sep(Entry): """A separator""" def __init__(self): self.align = Entry.StickBottom class App(Entry):
64
64
40
5
58
zen0bit/menumaker
MenuMaker/__init__.py
Python
App
App
105
112
105
106
2b9d13cf21d2c6971ed7f56eb356d1170b5b2ff8
bigcode/the-stack
train
5a289b02a6afdf4eb218ae81
train
function
def msg(s, newline=True): if verbose: sys.stderr.write(s) if newline: sys.stderr.write("\n") sys.stderr.flush()
def msg(s, newline=True):
if verbose: sys.stderr.write(s) if newline: sys.stderr.write("\n") sys.stderr.flush()
, KwS("Sakura")), (T.st, KwS("ST")), (T.alacritty, KwS("Alacritty")), (T.qterminal, KwS("QTerminal")), (T.sakura, KwS("Sakura")), ] def msg(s, newline=True):
64
64
33
7
57
zen0bit/menumaker
MenuMaker/__init__.py
Python
msg
msg
55
61
55
55
7acf7817c8f2d91ee98b3774caaa7ae2140935d6
bigcode/the-stack
train
f0108554e5d90225cb3f16f5
train
class
class StrategyGames(Menu): name = "Strategy" keywords = KwS(StrategyGame)
class StrategyGames(Menu):
name = "Strategy" keywords = KwS(StrategyGame)
(Menu): name = "Puzzle" keywords = KwS(LogicGame, BlocksGame) class SimGames(Menu): name = "Simulation" keywords = KwS(Simulation) class SportsGames(Menu): name = "Sports" keywords = KwS(SportsGame) class StrategyGames(Menu):
64
64
20
5
59
zen0bit/menumaker
MenuMaker/__init__.py
Python
StrategyGames
StrategyGames
385
387
385
385
ff832a91a253f73294d7a1f33b7c7a15b85c33b4
bigcode/the-stack
train
3ac2d2bac5501319e2cdbde9
train
class
class Sep(Entry): """A separator""" def __init__(self): self.align = Entry.StickBottom
class Sep(Entry):
"""A separator""" def __init__(self): self.align = Entry.StickBottom
0 # Element is subject to sorting # Element should be placed at the menu top retaining the original order StickTop = 1 StickBottom = 2 # ...at the bottom... def __init__(self): self.align = Entry.Floating class Sep(Entry):
64
64
26
5
58
zen0bit/menumaker
MenuMaker/__init__.py
Python
Sep
Sep
97
102
97
98
a0f140950787bf793a93915273067e0e1f3c74a8
bigcode/the-stack
train
185e71e7ec81edc3e07ef71e
train
class
class KDESettings(Menu): name = "KDE" def __init__(self, subs): subs = [ ("Look & Feel", KwS("X-KDE-settings-looknfeel")), ("Sound", KwS("X-KDE-settings-sound")), ("System", KwS("X-KDE-settings-system")), ("Accessibility", KwS("X-KDE-settings-accessibilit...
class KDESettings(Menu):
name = "KDE" def __init__(self, subs): subs = [ ("Look & Feel", KwS("X-KDE-settings-looknfeel")), ("Sound", KwS("X-KDE-settings-sound")), ("System", KwS("X-KDE-settings-system")), ("Accessibility", KwS("X-KDE-settings-accessibility")), ("Compo...
(app.keywords & self.keywords) == 2 def _kdeMenu(id, kws): class _Menu(Menu): name = id def suitable(self, app): return len( app.keywords & KwS(KDE, "X-KDE-settings")) and len(app.keywords & kws) return _Menu class KDESettings(Menu):
78
78
261
6
71
zen0bit/menumaker
MenuMaker/__init__.py
Python
KDESettings
KDESettings
286
311
286
286
665cf73e5457298b03735412bf9008ad0d3ea551
bigcode/the-stack
train
69aa80c40277e95dad87e37c
train
class
class SimGames(Menu): name = "Simulation" keywords = KwS(Simulation)
class SimGames(Menu):
name = "Simulation" keywords = KwS(Simulation)
Games(Menu): name = "Board" keywords = KwS(BoardGame) class CardGames(Menu): name = "Card" keywords = KwS(CardGame) class PuzzleGames(Menu): name = "Puzzle" keywords = KwS(LogicGame, BlocksGame) class SimGames(Menu):
64
64
19
5
59
zen0bit/menumaker
MenuMaker/__init__.py
Python
SimGames
SimGames
375
377
375
375
21e82991760d52849892bc0b2ffda04b953f4f48
bigcode/the-stack
train
3d7f48f4fa1ab3bcb444551e
train
function
def _menu(id, kws): class _Menu(Menu): name = id def suitable(self, app): return len(app.keywords & kws) > 0 return _Menu
def _menu(id, kws):
class _Menu(Menu): name = id def suitable(self, app): return len(app.keywords & kws) > 0 return _Menu
, NetApps, GraphicApps, Multimedia, Edutainment, Games, Shells, SystemApps, Utils, Misc ] super(Root, self).__init__([x([]) for x in subs]) def suitable(self, app): return True def _menu(id, kws):
64
64
43
7
56
zen0bit/menumaker
MenuMaker/__init__.py
Python
_menu
_menu
210
217
210
210
ace3bc92b15c1a9adf80a40d90cb7d1b0bb051d1
bigcode/the-stack
train
4a0de559327b4c8fbf871c22
train
class
class BoardGames(Menu): name = "Board" keywords = KwS(BoardGame)
class BoardGames(Menu):
name = "Board" keywords = KwS(BoardGame)
, Art, Construction, Music, Languages, Teaching) class AdventureGames(Menu): name = "Adventure" keywords = KwS(AdventureGame, RolePlaying) class ArcadeGames(Menu): name = "Arcade" keywords = KwS(ArcadeGame, ActionGame) class BoardGames(Menu):
64
64
19
5
59
zen0bit/menumaker
MenuMaker/__init__.py
Python
BoardGames
BoardGames
360
362
360
360
98f09983bd92ec757a4411eb426e9865804e9c9a
bigcode/the-stack
train
e9e70a4b8463d28609264b4e
train
class
class Root(Menu): def __init__(self): subs = [ DevApps, Editors, OfficeApps, ScienceApps, NetApps, GraphicApps, Multimedia, Edutainment, Games, Shells, SystemApps, Utils, Misc ] super(Root, self).__init__([x([]) for x in subs]) def suitable(self, app): r...
class Root(Menu):
def __init__(self): subs = [ DevApps, Editors, OfficeApps, ScienceApps, NetApps, GraphicApps, Multimedia, Edutainment, Games, Shells, SystemApps, Utils, Misc ] super(Root, self).__init__([x([]) for x in subs]) def suitable(self, app): return True
bottom #compare = staticmethod(lambda x, y : cmp(x.name.lower(), y.name.lower())) extract = staticmethod(lambda v: v.name.lower()) import os.path import fnmatch from Prophet.Categories import * from Keywords import Set as KwS, Keyword as Kw class Root(Menu):
64
64
83
4
59
zen0bit/menumaker
MenuMaker/__init__.py
Python
Root
Root
197
207
197
198
14bb3165c55c9100af944a1e85ccae9b926ab665
bigcode/the-stack
train
784ce80d71ec317683bd518e
train
class
class ArcadeGames(Menu): name = "Arcade" keywords = KwS(ArcadeGame, ActionGame)
class ArcadeGames(Menu):
name = "Arcade" keywords = KwS(ArcadeGame, ActionGame)
, MedicalSoftware, Physics) class Edutainment(Menu): name = "Education" keywords = KwS(Education, Art, Construction, Music, Languages, Teaching) class AdventureGames(Menu): name = "Adventure" keywords = KwS(AdventureGame, RolePlaying) class ArcadeGames(Menu):
64
64
25
5
59
zen0bit/menumaker
MenuMaker/__init__.py
Python
ArcadeGames
ArcadeGames
355
357
355
355
880a1e151d918c16afa73c91ae0689151b4f4233
bigcode/the-stack
train
dcebbf4f17ac544095b6f6d8
train
function
def indent(level): """Return indentation string for specified level""" x = "" while(level > 2): x += " " level -= 2 for i in range(0, level): x += " " return x
def indent(level):
"""Return indentation string for specified level""" x = "" while(level > 2): x += " " level -= 2 for i in range(0, level): x += " " return x
")), (T.qterminal, KwS("QTerminal")), (T.sakura, KwS("Sakura")), ] def msg(s, newline=True): if verbose: sys.stderr.write(s) if newline: sys.stderr.write("\n") sys.stderr.flush() def indent(level):
64
64
56
4
60
zen0bit/menumaker
MenuMaker/__init__.py
Python
indent
indent
64
72
64
64
7b2b4b564019ef8d1961d252291e8cfbc2ee3491
bigcode/the-stack
train
9ffd06868b8f0876dd8fab6e
train
function
def setFrontend(module): """Specify the frontend to use""" for x in (Entry, Sep, App, Menu, Root): try: x.__bases__ = (getattr(module, x.__name__),) + x.__bases__ except AttributeError: pass
def setFrontend(module):
"""Specify the frontend to use""" for x in (Entry, Sep, App, Menu, Root): try: x.__bases__ = (getattr(module, x.__name__),) + x.__bases__ except AttributeError: pass
.stderr.flush() def indent(level): """Return indentation string for specified level""" x = "" while(level > 2): x += " " level -= 2 for i in range(0, level): x += " " return x def setFrontend(module):
64
64
60
5
58
zen0bit/menumaker
MenuMaker/__init__.py
Python
setFrontend
setFrontend
75
81
75
75
f28b8ee3fe4b468b862be1e215c4592b94d52f85
bigcode/the-stack
train
e8f409496177cc7901e4d0d6
train
class
class ToyGames(Menu): name = "Amusement" keywords = KwS(Amusement, KidsGame)
class ToyGames(Menu):
name = "Amusement" keywords = KwS(Amusement, KidsGame)
class SimGames(Menu): name = "Simulation" keywords = KwS(Simulation) class SportsGames(Menu): name = "Sports" keywords = KwS(SportsGame) class StrategyGames(Menu): name = "Strategy" keywords = KwS(StrategyGame) class ToyGames(Menu):
64
64
24
5
59
zen0bit/menumaker
MenuMaker/__init__.py
Python
ToyGames
ToyGames
390
392
390
390
e7aad3fd8d79b514e5a2c4ee0a40817647384787
bigcode/the-stack
train
492721cf77cdedfcb7f54e3f
train
class
class AdventureGames(Menu): name = "Adventure" keywords = KwS(AdventureGame, RolePlaying)
class AdventureGames(Menu):
name = "Adventure" keywords = KwS(AdventureGame, RolePlaying)
keywords = KwS(Electronics, Engineering, Science, Astronomy, Biology, Chemistry, Geology, Math, MedicalSoftware, Physics) class Edutainment(Menu): name = "Education" keywords = KwS(Education, Art, Construction, Music, Languages, Teaching) class AdventureGames(Menu):
64
64
23
5
59
zen0bit/menumaker
MenuMaker/__init__.py
Python
AdventureGames
AdventureGames
350
352
350
350
ad21fc58ef9fdbc93d496de1885c89064fb46ff5
bigcode/the-stack
train
6513aec7e753ca9f3ff054e1
train
function
def GetName(item): unwrapped = UnwrapElement(item) if not unwrapped: return None elif unwrapped.GetType().ToString() in ("Autodesk.Revit.DB.BuiltInParameter", "Autodesk.Revit.DB.BuiltInParameterGroup", "Autodesk.Revit.DB.DisplayUnitType", "Autodesk.Revit.DB.ParameterType", "Autodesk.Revit.DB.UnitSymbolType", "Autode...
def GetName(item):
unwrapped = UnwrapElement(item) if not unwrapped: return None elif unwrapped.GetType().ToString() in ("Autodesk.Revit.DB.BuiltInParameter", "Autodesk.Revit.DB.BuiltInParameterGroup", "Autodesk.Revit.DB.DisplayUnitType", "Autodesk.Revit.DB.ParameterType", "Autodesk.Revit.DB.UnitSymbolType", "Autodesk.Revit.DB.UnitTyp...
import clr clr.AddReference('RevitAPI') from Autodesk.Revit.DB import * def GetName(item):
23
64
165
5
18
andydandy74/ClockworkForDynamo
nodes/1.x/python/Element.Name+.py
Python
GetName
GetName
5
12
5
5
21fd3678e32433fe2e8e29cf6d9806d3b0d9d980
bigcode/the-stack
train
4797b9c0a0b5a645efde1daf
train
function
@pytest.mark.parametrize("par", [(par1), (par2), (par3), (par4), (par5), (par6)]) def test_Fredholm1(par): """Dot-test and inversion for Fredholm1 operator """ np.random.seed(10) _F = np.arange(par['nsl'] * par['nx'] * par['ny']).reshape...
@pytest.mark.parametrize("par", [(par1), (par2), (par3), (par4), (par5), (par6)]) def test_Fredholm1(par):
"""Dot-test and inversion for Fredholm1 operator """ np.random.seed(10) _F = np.arange(par['nsl'] * par['nx'] * par['ny']).reshape(par['nsl'], par['nx'], par['ny']) F = _F -...
': 6, 'nx': 4, 'nz': 1, 'usematmul': True, 'saveGt': False, 'imag': 0, 'dtype': 'float32'} # real, unsaved Gt, nz=1 @pytest.mark.parametrize("par", [(par1), (par2), (par3), (par4), (par5), (par6)]) def test_Fredholm1(par):
97
97
324
40
56
SoftwareUnderstanding/inspect4py
test/test_files/pylops/pytests/test_fredholm.py
Python
test_Fredholm1
test_Fredholm1
30
54
30
33
7c69f0bc388c8ad1000e426d0bd4dbc37532326f
bigcode/the-stack
train
b5d455e9f632b813de677e99
train
function
def create_dir(dir_path): # 生成文件夹 if not os.path.isdir(dir_path): os.makedirs(dir_path) return
def create_dir(dir_path): # 生成文件夹
if not os.path.isdir(dir_path): os.makedirs(dir_path) return
"""辅助函数 """ import os import yaml from collections import namedtuple def create_dir(dir_path): # 生成文件夹
30
64
31
13
16
quqixun/GNN-Pytorch
Node/GraphSAGE/script/utils.py
Python
create_dir
create_dir
11
15
11
12
16b2645224f883d220e0b8f3f539a13749e33517
bigcode/the-stack
train
d924ba36d9eb5d0382748036
train
function
def load_config(config_file): """加载全局配置 加载模型参数和训练超参数, 用于不同的数据集训练模型 """ with open(config_file, 'r', encoding='utf-8') as f: # 读取yaml文件内容 config = yaml.load(f, Loader=yaml.FullLoader) return config
def load_config(config_file):
"""加载全局配置 加载模型参数和训练超参数, 用于不同的数据集训练模型 """ with open(config_file, 'r', encoding='utf-8') as f: # 读取yaml文件内容 config = yaml.load(f, Loader=yaml.FullLoader) return config
'train_index', # 训练集样本索引 'valid_index', # 验证集样本索引 'adjacency_dict' # 节点邻居字典 ] ) # 加载全局配置 def load_config(config_file):
64
64
76
6
57
quqixun/GNN-Pytorch
Node/GraphSAGE/script/utils.py
Python
load_config
load_config
47
58
47
47
70a89c7a0edddc6851495f4eddd0b18fc548b480
bigcode/the-stack
train
736fe9e59d072e7e5a007641
train
class
class FinalABCMetaTestCase(FinalMetaTestCase): @classmethod def setUpClass(cls): FinalABCMeta = compose_types(FinalMeta, ABCMeta) class ABCWithFinal(with_metaclass(FinalABCMeta, object)): a = final('ABCWithFinal: a') b = 'ABCWithFinal: b' @final ...
class FinalABCMetaTestCase(FinalMetaTestCase): @classmethod
def setUpClass(cls): FinalABCMeta = compose_types(FinalMeta, ABCMeta) class ABCWithFinal(with_metaclass(FinalABCMeta, object)): a = final('ABCWithFinal: a') b = 'ABCWithFinal: b' @final def f(self): return 'ABCWithFinal: f' ...
raise try: with self.assertRaises(TypeError): self.class_.a = 'SubClass: a' except Exception: self.class_.a = old_a raise def test_override___setattr___on_subclass(self): """ Tests an attempt to override _...
197
197
659
16
180
guilhermeprokisch/catalyst
tests/utils/test_final.py
Python
FinalABCMetaTestCase
FinalABCMetaTestCase
159
264
159
160
071a0f12e599bf8ea815a46368719f20deff79aa
bigcode/the-stack
train
bdac648a06dc1655c833a1dc
train
class
class FinalMetaTestCase(TestCase): @classmethod def setUpClass(cls): class ClassWithFinal(with_metaclass(FinalMeta, object)): a = final('ClassWithFinal: a') b = 'ClassWithFinal: b' @final def f(self): return 'ClassWithFinal: f' ...
class FinalMetaTestCase(TestCase): @classmethod
def setUpClass(cls): class ClassWithFinal(with_metaclass(FinalMeta, object)): a = final('ClassWithFinal: a') b = 'ClassWithFinal: b' @final def f(self): return 'ClassWithFinal: f' def g(self): return 'Cla...
from abc import abstractmethod, ABCMeta from unittest import TestCase from six import with_metaclass from catalyst.utils.final import ( FinalMeta, final, ) from catalyst.utils.metautils import compose_types class FinalMetaTestCase(TestCase): @classmethod
58
256
911
12
45
guilhermeprokisch/catalyst
tests/utils/test_final.py
Python
FinalMetaTestCase
FinalMetaTestCase
13
156
13
14
116246a5f1b5333b2cab78c584436d531b323203
bigcode/the-stack
train
ab8b3a394c3aa92a711256a6
train
function
def create_test_network_6(): """Aligned network with dropout for test. The graph is similar to create_test_network_1(), except that the right branch has dropout normalization. Returns: g: Tensorflow graph object (Graph proto). """ g = ops.Graph() with g.as_default(): # An 8x8 test image. x =...
def create_test_network_6():
"""Aligned network with dropout for test. The graph is similar to create_test_network_1(), except that the right branch has dropout normalization. Returns: g: Tensorflow graph object (Graph proto). """ g = ops.Graph() with g.as_default(): # An 8x8 test image. x = array_ops.placeholder(dtypes...
, 1, [3, 5], stride=2, scope='L1', padding='VALID') l2 = slim.conv2d(l1, 1, [3, 1], stride=2, scope='L2', padding='VALID') # ReLU. nn.relu(l2, name='output') return g def create_test_network_6():
82
82
276
7
74
worldveil/tensorflow
tensorflow/contrib/receptive_field/python/util/receptive_field_test.py
Python
create_test_network_6
create_test_network_6
156
178
156
156
ff91800eee3181f391e8dca10e6fbefb85e5f61a
bigcode/the-stack
train
0d126287cc5d7552d52fc68e
train
function
def create_test_network_4(): """Misaligned network for test. The graph corresponds to a variation from the example from the second figure in go/cnn-rf-computation#arbitrary-computation-graphs. Layer 2 uses 'SAME' padding, which makes its padding dependent on the input image dimensionality. In this case, the ...
def create_test_network_4():
"""Misaligned network for test. The graph corresponds to a variation from the example from the second figure in go/cnn-rf-computation#arbitrary-computation-graphs. Layer 2 uses 'SAME' padding, which makes its padding dependent on the input image dimensionality. In this case, the effective padding will be und...
2d(x, 1, [3, 3], stride=1, scope='L2', padding='VALID') l3 = slim.conv2d(l2, 1, [3, 3], stride=1, scope='L3', padding='VALID') # Addition. nn.relu(l1 + l3, name='output') return g def create_test_network_4():
87
87
292
7
79
worldveil/tensorflow
tensorflow/contrib/receptive_field/python/util/receptive_field_test.py
Python
create_test_network_4
create_test_network_4
108
131
108
108
9f89d7b909c97b02b1b0313b37873d5dac8a5e61
bigcode/the-stack
train
bb8317f6541e5a5eb4e25993
train
function
def create_test_network_2(): """Aligned network for test. The graph corresponds to a variation to the example from the second figure in go/cnn-rf-computation#arbitrary-computation-graphs. Layers 2 and 3 are changed to max-pooling operations. Since the functionality is the same as convolution, the network is ...
def create_test_network_2():
"""Aligned network for test. The graph corresponds to a variation to the example from the second figure in go/cnn-rf-computation#arbitrary-computation-graphs. Layers 2 and 3 are changed to max-pooling operations. Since the functionality is the same as convolution, the network is aligned and the receptive fie...
0]]) l2 = slim.conv2d(l2_pad, 1, [3, 3], stride=2, scope='L2', padding='VALID') l3 = slim.conv2d(l2, 1, [1, 1], stride=2, scope='L3', padding='VALID') # Addition. nn.relu(l1 + l3, name='output') return g def create_test_network_2():
97
97
325
7
89
worldveil/tensorflow
tensorflow/contrib/receptive_field/python/util/receptive_field_test.py
Python
create_test_network_2
create_test_network_2
57
81
57
57
207c900e60f30211abc5c9f474cc3e9f23d81189
bigcode/the-stack
train
8a0920e576d04a2fc62446cc
train
function
def create_test_network_5(): """Single-path network for testing non-square kernels. The graph is similar to the right branch of the graph from create_test_network_1(), except that the kernel sizes are changed to be non-square. Returns: g: Tensorflow graph object (Graph proto). """ g = ops.Graph() ...
def create_test_network_5():
"""Single-path network for testing non-square kernels. The graph is similar to the right branch of the graph from create_test_network_1(), except that the kernel sizes are changed to be non-square. Returns: g: Tensorflow graph object (Graph proto). """ g = ops.Graph() with g.as_default(): # An...
='SAME') l3 = slim.conv2d(l2, 1, [1, 1], stride=2, scope='L3', padding='VALID') # Addition. nn.relu(l1 + l3, name='output') return g def create_test_network_5():
65
65
219
7
57
worldveil/tensorflow
tensorflow/contrib/receptive_field/python/util/receptive_field_test.py
Python
create_test_network_5
create_test_network_5
134
153
134
134
2f6dbf6ebdcd04f9ea264cdae4afc48ff2302a84
bigcode/the-stack
train
bd8deed479860f6d426d6215
train
function
def create_test_network_7(): """Aligned network for test, with a control dependency. The graph is similar to create_test_network_1(), except that it includes an assert operation on the left branch. Returns: g: Tensorflow graph object (Graph proto). """ g = ops.Graph() with g.as_default(): # An 8...
def create_test_network_7():
"""Aligned network for test, with a control dependency. The graph is similar to create_test_network_1(), except that it includes an assert operation on the left branch. Returns: g: Tensorflow graph object (Graph proto). """ g = ops.Graph() with g.as_default(): # An 8x8 test image. x = array_...
slim.conv2d(l2_pad, 1, [3, 3], stride=2, scope='L2', padding='VALID') l3 = slim.conv2d(l2, 1, [1, 1], stride=2, scope='L3', padding='VALID') dropout = slim.dropout(l3) # Addition. nn.relu(l1 + dropout, name='output') return g def create_test_network_7():
98
98
327
7
90
worldveil/tensorflow
tensorflow/contrib/receptive_field/python/util/receptive_field_test.py
Python
create_test_network_7
create_test_network_7
181
206
181
181
79bd5a8954c8f1b3177b705475d9d104b5eb2e60
bigcode/the-stack
train
6786b0c544c9c4143a9fe1c4
train
function
def create_test_network_3(): """Misaligned network for test. The graph corresponds to the example from the first figure in go/cnn-rf-computation#arbitrary-computation-graphs Returns: g: Tensorflow graph object (Graph proto). """ g = ops.Graph() with g.as_default(): # An 8x8 test image. x = a...
def create_test_network_3():
"""Misaligned network for test. The graph corresponds to the example from the first figure in go/cnn-rf-computation#arbitrary-computation-graphs Returns: g: Tensorflow graph object (Graph proto). """ g = ops.Graph() with g.as_default(): # An 8x8 test image. x = array_ops.placeholder(dtypes.f...
(l2_pad, [3, 3], stride=2, scope='L2', padding='VALID') l3 = slim.max_pool2d(l2, [1, 1], stride=2, scope='L3', padding='VALID') # Addition. nn.relu(l1 + l3, name='output') return g def create_test_network_3():
82
82
274
7
74
worldveil/tensorflow
tensorflow/contrib/receptive_field/python/util/receptive_field_test.py
Python
create_test_network_3
create_test_network_3
84
105
84
84
7244fbdca919f36b0d11b08ff8698fe07800dfd2
bigcode/the-stack
train
6249405757e43f4bf72b76e2
train
function
def create_test_network_1(): """Aligned network for test. The graph corresponds to the example from the second figure in go/cnn-rf-computation#arbitrary-computation-graphs Returns: g: Tensorflow graph object (Graph proto). """ g = ops.Graph() with g.as_default(): # An 8x8 test image. x = arr...
def create_test_network_1():
"""Aligned network for test. The graph corresponds to the example from the second figure in go/cnn-rf-computation#arbitrary-computation-graphs Returns: g: Tensorflow graph object (Graph proto). """ g = ops.Graph() with g.as_default(): # An 8x8 test image. x = array_ops.placeholder(dtypes.flo...
from tensorflow.contrib.receptive_field.python.util import receptive_field from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tensorflow.python.ops import array_ops from tensorflow.python.ops import control_flow_ops from tensorflow.python.ops import gen_math_ops from tensor...
81
81
273
7
73
worldveil/tensorflow
tensorflow/contrib/receptive_field/python/util/receptive_field_test.py
Python
create_test_network_1
create_test_network_1
33
54
33
33
78513d253bb76cb04cd25ef9353fd5e64d5f71d2
bigcode/the-stack
train
ae745de6f09fadcd6c7759cc
train
class
class RfUtilsTest(test.TestCase): def testComputeRFFromGraphDefAligned(self): graph_def = create_test_network_1().as_graph_def() input_node = 'input_image' output_node = 'output' (receptive_field_x, receptive_field_y, effective_stride_x, effective_stride_y, effective_padding_x, effective_padding...
class RfUtilsTest(test.TestCase):
def testComputeRFFromGraphDefAligned(self): graph_def = create_test_network_1().as_graph_def() input_node = 'input_image' output_node = 'output' (receptive_field_x, receptive_field_y, effective_stride_x, effective_stride_y, effective_padding_x, effective_padding_y) = ( receptive_field.co...
test image. x = array_ops.placeholder(dtypes.float32, (1, 8, 8, 1), name='input_image') # Left branch. l1 = slim.conv2d(x, 1, [1, 1], stride=4, scope='L1', padding='VALID') l1_shape = array_ops.shape(l1) assert_op = control_flow_ops.Assert( gen_math_ops.equal(l1_shape[1], 2), [l1_shape], su...
256
256
1,233
9
246
worldveil/tensorflow
tensorflow/contrib/receptive_field/python/util/receptive_field_test.py
Python
RfUtilsTest
RfUtilsTest
209
323
209
210
00444785188da22a51cbec21ae55b4a8801c892b
bigcode/the-stack
train
bf1f52b2c602c245a343e5a1
train
function
def callback(in_data, frame_count, time_info, status): data = wf.readframes(frame_count) return (data, pyaudio.paContinue)
def callback(in_data, frame_count, time_info, status):
data = wf.readframes(frame_count) return (data, pyaudio.paContinue)
try: WAVE_FILE = sys.argv[1] except: print('File name is required as an argument.') sys.exit(1) audio = pyaudio.PyAudio() wf = wave.open(WAVE_FILE, 'rb') def callback(in_data, frame_count, time_info, status):
64
64
33
13
51
yutashi/cresc
basics/play-wave-threading.py
Python
callback
callback
18
20
18
18
4ea9720c563e7480dd547de895c5c1bb13674276
bigcode/the-stack
train
bfc444c2f05a0ea4fbc19ce4
train
function
def _get_data(model, var, sum_dims=None): var_da = model.get_formatted_array(var).rename({"nodes": "nodes_to"}) if sum_dims: var_da = var_da.sum(dim=sum_dims) techs = list( set(model._model_data.techs_transmission.values).intersection( var_da.techs.values ) ) var...
def _get_data(model, var, sum_dims=None):
var_da = model.get_formatted_array(var).rename({"nodes": "nodes_to"}) if sum_dims: var_da = var_da.sum(dim=sum_dims) techs = list( set(model._model_data.techs_transmission.values).intersection( var_da.techs.values ) ) var_df = var_da.loc[dict(techs=techs)].to_pan...
(*bounds) metres_per_pixel = max_distance / width for k, v in zoom_dict.items(): if v > metres_per_pixel: continue else: zoom = k - 4 break return zoom def _get_data(model, var, sum_dims=None):
64
64
180
12
51
wroldwiedbwe/calliope
calliope/postprocess/plotting/transmission.py
Python
_get_data
_get_data
69
90
69
69
21d04a7f4a77eede51ef6ec667a4aae0b741ef16
bigcode/the-stack
train
7086577a126669fe41a55cf5
train
function
def _fill_scatter(coordinates, energy_cap, scatter_dict, dict_entry, tech): mid_edge = ( lambda _from, _to: ( coordinates.loc[{"nodes": _from, "coordinates": dict_entry}] + coordinates.loc[{"nodes": _to, "coordinates": dict_entry}] ).item() / 2 ) edge = lambd...
def _fill_scatter(coordinates, energy_cap, scatter_dict, dict_entry, tech):
mid_edge = ( lambda _from, _to: ( coordinates.loc[{"nodes": _from, "coordinates": dict_entry}] + coordinates.loc[{"nodes": _to, "coordinates": dict_entry}] ).item() / 2 ) edge = lambda _from, _to: [ coordinates.loc[{"nodes": _from, "coordinates": dict...
_var = var_df[ (var_df != 0) & (var_df.columns.isin(model._model_data.techs_transmission.values)) ] clean_var.columns = pd.MultiIndex.from_tuples( clean_var.columns.str.split(":").tolist(), names=["techs", "nodes_from"] ) return xr.DataArray.from_series(clean_var.stack().stack(...
98
98
328
19
79
wroldwiedbwe/calliope
calliope/postprocess/plotting/transmission.py
Python
_fill_scatter
_fill_scatter
93
130
93
93
0346a6ac65aba9afbc74a51e4de37a68712ee462
bigcode/the-stack
train
cdf620540de5a6e13a32940f
train
function
def _get_zoom(coordinate_array, width): """ If mapbox is being used for tranmission plotting, get the zoom based on the bounding area of the input data and the width (in pixels) of the map """ # Keys are zoom levels, values are m/pixel at that zoom level zoom_dict = { 0: 156412, ...
def _get_zoom(coordinate_array, width):
""" If mapbox is being used for tranmission plotting, get the zoom based on the bounding area of the input data and the width (in pixels) of the map """ # Keys are zoom levels, values are m/pixel at that zoom level zoom_dict = { 0: 156412, 1: 78206, 2: 39103, 3: ...
Copyright (C) 2013-2019 Calliope contributors listed in AUTHORS. Licensed under the Apache 2.0 License (see LICENSE file). transmission.py ~~~~~~~~~~~~~~~ Plot transmission data. """ import pandas as pd import xarray as xr import numpy as np from calliope.preprocess.util import vincenty from calliope.postprocess.p...
99
99
332
10
88
wroldwiedbwe/calliope
calliope/postprocess/plotting/transmission.py
Python
_get_zoom
_get_zoom
20
66
20
20
01aa3b01589a24ae5e5b2be34973f842ff87c7fb
bigcode/the-stack
train
25b2fd3afad3d1159d3bbae0
train
function
def _get_centre(coordinates): """ Get centre of a map based on given lat and lon coordinates """ centre = (coordinates.max(dim="nodes") + coordinates.min(dim="nodes")) / 2 return dict( lat=centre.loc[dict(coordinates="lat")].item(), lon=centre.loc[dict(coordinates="lon")].item(), ...
def _get_centre(coordinates):
""" Get centre of a map based on given lat and lon coordinates """ centre = (coordinates.max(dim="nodes") + coordinates.min(dim="nodes")) / 2 return dict( lat=centre.loc[dict(coordinates="lat")].item(), lon=centre.loc[dict(coordinates="lon")].item(), )
filled_list.append("{} capacity: {}".format(tech, e_cap)) else: filled_list.append( edge(loc_from, loc_to) if scatter_dict == "edge" else mid_edge(loc_from, loc_to) ) ...
64
64
83
8
55
wroldwiedbwe/calliope
calliope/postprocess/plotting/transmission.py
Python
_get_centre
_get_centre
133
142
133
133
1247624180d4e36a1461cdda25af545daf6a0d15
bigcode/the-stack
train
58bed6f945afa8b91cdcb9c0
train
function
def plot_transmission(model, mapbox_access_token=None, **kwargs): """ Parameters ---------- mapbox_access_token : str, optional If given and a valid Mapbox API key, a Mapbox map is drawn for lat-lon coordinates, else (by default), a more simple built-in map. """ try: ...
def plot_transmission(model, mapbox_access_token=None, **kwargs):
""" Parameters ---------- mapbox_access_token : str, optional If given and a valid Mapbox API key, a Mapbox map is drawn for lat-lon coordinates, else (by default), a more simple built-in map. """ try: coordinates = model._model_data.loc_coordinates.sortby("nodes...
techs=tech)].nodes_to: if [loc_to, loc_from] in links: continue e_cap = energy_cap.loc[ dict(techs=tech, nodes_to=loc_to, nodes_from=loc_from) ].fillna(0) if e_cap: links.append([loc_from, loc_to]) if dict_en...
256
256
1,206
15
241
wroldwiedbwe/calliope
calliope/postprocess/plotting/transmission.py
Python
plot_transmission
plot_transmission
145
312
145
145
bc2416e792d3f451c0c3235701ce9c6720ffe3b1
bigcode/the-stack
train
3af847a1a80a2016e23fefb7
train
class
class ResponseTypes(object): CLASSES = { 'text/html': 'scrapy.http.HtmlResponse', 'application/atom+xml': 'scrapy.http.XmlResponse', 'application/rdf+xml': 'scrapy.http.XmlResponse', 'application/rss+xml': 'scrapy.http.XmlResponse', 'application/xhtml+xml': 'scrapy.http.Html...
class ResponseTypes(object):
CLASSES = { 'text/html': 'scrapy.http.HtmlResponse', 'application/atom+xml': 'scrapy.http.XmlResponse', 'application/rdf+xml': 'scrapy.http.XmlResponse', 'application/rss+xml': 'scrapy.http.XmlResponse', 'application/xhtml+xml': 'scrapy.http.HtmlResponse', 'applicatio...
""" This module implements a class which returns the appropriate Response class based on different criteria. """ from __future__ import absolute_import from mimetypes import MimeTypes from pkgutil import get_data from io import StringIO import six from scrapy.http import Response from scrapy.utils.misc import load_obj...
85
256
918
5
79
gunblues/scrapy
scrapy/responsetypes.py
Python
ResponseTypes
ResponseTypes
16
119
16
17
18e4454d5f58a91f625e3f09c6c8e5b12b414989
bigcode/the-stack
train
1b1df35554b8a4721b67b865
train
function
def write_bshc(filename, coeffs, lmax=None): """ Write real spherical harmonic coefficients to a binary bshc file. Usage ----- write_bshc(filename, coeffs, [lmax]) Parameters ---------- filename : str File name of the binary 'bshc'-formatted spherical harmonic coefficie...
def write_bshc(filename, coeffs, lmax=None):
""" Write real spherical harmonic coefficients to a binary bshc file. Usage ----- write_bshc(filename, coeffs, [lmax]) Parameters ---------- filename : str File name of the binary 'bshc'-formatted spherical harmonic coefficients. If filename ends with '.gz' the file wil...
:d}. Input degree is {:d}.' .format(degree_end, lmax)) coeffs = _np.zeros((2, lmax+1, lmax+1)) for degree in range(degree_start, lmax+1): n = degree + 1 coeffs[0, degree, 0:n] = _struct.unpack('<{}d'.format(n), ...
197
198
661
14
182
mjc87/SHTOOLS
pyshtools/shio/bshc.py
Python
write_bshc
write_bshc
112
176
112
112
4d5a96efcd553b8aa09ecddb0ad75bb164cc46e6
bigcode/the-stack
train
fe176db9a05cb9c33ab299ba
train
function
def read_bshc(filename, lmax=None): """ Read real spherical harmonic coefficients from a binary bshc file. Usage ----- coeffs, lmaxout = read_bshc(filename, [lmax]) Returns ------- coeffs : ndarray, size(2, lmaxout+1, lmaxout+1) The spherical harmonic coefficients. lmaxout ...
def read_bshc(filename, lmax=None):
""" Read real spherical harmonic coefficients from a binary bshc file. Usage ----- coeffs, lmaxout = read_bshc(filename, [lmax]) Returns ------- coeffs : ndarray, size(2, lmaxout+1, lmaxout+1) The spherical harmonic coefficients. lmaxout : int The maximum spherical ...
""" Functions for reading and writing real spherical harmonic coefficients in the binary 'bshc' format used by Curtin University. """ import io as _io import struct as _struct import gzip as _gzip import zipfile as _zipfile import numpy as _np import requests as _requests import shutil as _shutil def read_bshc(filename...
83
256
991
11
71
mjc87/SHTOOLS
pyshtools/shio/bshc.py
Python
read_bshc
read_bshc
14
109
14
14
7b80329e40bf7c0fceb08f6c55621778786a58ef
bigcode/the-stack
train
69554043835dc355832cdd82
train
function
def _isurl(filename): """ Determine if filename is a URL. Valid URLs start with 'http://' 'https://' 'ftp://' """ if filename[0:7].lower() == 'http://': return True elif filename[0:8].lower() == 'https://': return True elif filename[0:6].lower() == 'ftp://...
def _isurl(filename):
""" Determine if filename is a URL. Valid URLs start with 'http://' 'https://' 'ftp://' """ if filename[0:7].lower() == 'http://': return True elif filename[0:8].lower() == 'https://': return True elif filename[0:6].lower() == 'ftp://': return True...
1, degree, 0:n])) if filename[-3:] == '.gz': with open(filebase, 'rb') as f_in: with _gzip.open(filename, 'wb') as f_out: _shutil.copyfileobj(f_in, f_out) def _isurl(filename):
64
64
102
6
58
mjc87/SHTOOLS
pyshtools/shio/bshc.py
Python
_isurl
_isurl
179
193
179
179
297bcd7ce29e5696ec94f70fc3a3e1bd0fafdd70
bigcode/the-stack
train
b22d6ed6e5b36134f41ce8a9
train
function
def argument_to_ability(ability_type): return deck.ABILITIES.get(relations.ABILITY_TYPE(ability_type))
def argument_to_ability(ability_type):
return deck.ABILITIES.get(relations.ABILITY_TYPE(ability_type))
import smart_imports smart_imports.all() def argument_to_ability(ability_type):
21
64
26
10
11
devapromix/the-tale
src/the_tale/the_tale/game/abilities/views.py
Python
argument_to_ability
argument_to_ability
7
7
7
7
fd1c9304a3113638da2d24a887b0e44635f28d8f
bigcode/the-stack
train
d2fd1a3c41c0015362d3ec9e
train
class
class AbilitiesResource(utils_resources.Resource): @utils_decorators.login_required @dext_old_views.validate_argument('ability', argument_to_ability, 'abilities', 'Неверный идентификатор способности') def initialize(self, ability=None, *argv, **kwargs): super(AbilitiesResource, self).initialize(*ar...
class AbilitiesResource(utils_resources.Resource): @utils_decorators.login_required @dext_old_views.validate_argument('ability', argument_to_ability, 'abilities', 'Неверный идентификатор способности')
def initialize(self, ability=None, *argv, **kwargs): super(AbilitiesResource, self).initialize(*argv, **kwargs) self.ability = ability() @utils_api.handler(versions=('1.0',)) @dext_old_views.validate_argument('battle', int, 'abilities', 'Неверный идентификатор сражения') @dext_old_views...
_type): return deck.ABILITIES.get(relations.ABILITY_TYPE(ability_type)) class AbilitiesResource(utils_resources.Resource): @utils_decorators.login_required @dext_old_views.validate_argument('ability', argument_to_ability, 'abilities', 'Неверный идентификатор способности')
64
64
213
45
19
devapromix/the-tale
src/the_tale/the_tale/game/abilities/views.py
Python
AbilitiesResource
AbilitiesResource
10
28
10
13
fbc3c89aa440a61b48e2cb1ba1ddfad32aff20d4
bigcode/the-stack
train
ff9d7ae286d1191f676ff529
train
function
def default_urlpatterns(connector): url_config = ( ('.views.login_view', 'login/', '_universal_importer_login'), ('.views.callback_view', 'callback/', '_universal_importer_callback'), ('.views.storage_view', 'storage/', '_storage'), ('.views.importer_view', 'import/', '_import'), ...
def default_urlpatterns(connector):
url_config = ( ('.views.login_view', 'login/', '_universal_importer_login'), ('.views.callback_view', 'callback/', '_universal_importer_callback'), ('.views.storage_view', 'storage/', '_storage'), ('.views.importer_view', 'import/', '_import'), ('.views.token_list_view', 'tok...
from allauth.utils import import_attribute from django.urls import path, include def default_urlpatterns(connector):
23
64
170
7
15
LikaloLLC/docsie-universal-doc-importer
docsie_universal_importer/providers/base/urls.py
Python
default_urlpatterns
default_urlpatterns
5
24
5
5
98900cc636c92dd4afbbe2d1c6e6d717ca38ce56
bigcode/the-stack
train
0636f9ed1bf801497147af1f
train
function
def test_main(): with test_support.check_py3k_warnings(("buffer.. not supported", DeprecationWarning)): test_support.run_unittest(BufferTests)
def test_main():
with test_support.check_py3k_warnings(("buffer.. not supported", DeprecationWarning)): test_support.run_unittest(BufferTests)
# See issue #22995 ## def test_pickle(self): ## buf = buffer(b'abc') ## for proto in range(pickle.HIGHEST_PROTOCOL + 1): ## with self.assertRaises(TypeError): ## pickle.dumps(buf, proto) def test_main():
64
64
35
4
60
jeikabu/lumberyard
dev/Tools/Python/2.7.13/mac/Python.framework/Versions/2.7/lib/python2.7/test/test_buffer.py
Python
test_main
test_main
53
56
53
53
9779559f3b8708b0252f29ffa533fe38be5af5c1
bigcode/the-stack
train
1a1fb83fa86d007e8f222b69
train
class
class BufferTests(unittest.TestCase): def test_extended_getslice(self): # Test extended slicing by comparing with list slicing. s = "".join(chr(c) for c in list(range(255, -1, -1))) b = buffer(s) indices = (0, None, 1, 3, 19, 300, -1, -2, -31, -300) for start in indices: ...
class BufferTests(unittest.TestCase):
def test_extended_getslice(self): # Test extended slicing by comparing with list slicing. s = "".join(chr(c) for c in list(range(255, -1, -1))) b = buffer(s) indices = (0, None, 1, 3, 19, 300, -1, -2, -31, -300) for start in indices: for stop in indices: ...
"""Unit tests for buffer objects. For now, tests just new or changed functionality. """ import copy import pickle import sys import unittest from test import test_support class BufferTests(unittest.TestCase):
43
87
290
7
35
jeikabu/lumberyard
dev/Tools/Python/2.7.13/mac/Python.framework/Versions/2.7/lib/python2.7/test/test_buffer.py
Python
BufferTests
BufferTests
13
43
13
14
7a795167dddfb7a4ad7eb095de2d405f48ca02bb
bigcode/the-stack
train
23f6f74bfe216a99f570d9fb
train
function
@app.route("/new_thread", methods=["POST"]) def new_thread(): if not session["csrf_token"] == request.form["csrf_token"]: abort(403) topic = request.form["topic"] content = request.form["content"] category_id = request.form["category_id"] if not users.category_access(session.get("us...
@app.route("/new_thread", methods=["POST"]) def new_thread():
if not session["csrf_token"] == request.form["csrf_token"]: abort(403) topic = request.form["topic"] content = request.form["content"] category_id = request.form["category_id"] if not users.category_access(session.get("user_id"), category_id): return render_template("error.ht...
if not message_posted: render_template("error.html", message="Viestin lähetys epäonnistui. Viestin tulee olla 1-5000 merkkiä pitkä") return redirect("/thread/"+str(thread_id)) @app.route("/new_thread", methods=["POST"]) def new_thread():
64
64
180
15
49
Ronttikasa/foorumisovellus
routes.py
Python
new_thread
new_thread
90
106
90
91
27876794dcb3c3a0bf7feefdb4ab6fe385064576
bigcode/the-stack
train